Node.js Soap:rpc样式绑定的无效消息定义

我试图从节点使用wsdl。 使用'vpulim / node-soap'。

我可以加载wsdl,描述它,甚至调用某些函数。 但是,任何时候我试图调用一个不期望任何参数的函数,我得到的错误:

assert.js:92 throw new assert.AssertionError({ ^ AssertionError: invalid message definition for rpc style binding at Client._invoke (/home/user/node_scripts/application/node_modules/soap/lib/client.js:126:12) at null.getManagedModules (/home/user/node_scripts/application/node_modules/soap/lib/client.js:87:10) at /home/user/node_scripts/application/client.js:9:12 at /home/user/node_scripts/application/node_modules/soap/lib/soap.js:48:5 at null.callback (/home/user/node_scripts/application/node_modules/soap/lib/soap.js:35:7) at /home/user/node_scripts/application/node_modules/soap/lib/wsdl.js:716:12 at WSDL._processNextInclude (/home/user/node_scripts/application/node_modules/soap/lib/wsdl.js:732:12) at WSDL.processIncludes (/home/user/node_scripts/application/node_modules/soap/lib/wsdl.js:762:8) at /home/user/node_scripts/application/node_modules/soap/lib/wsdl.js:678:10 at process._tickCallback (node.js:415:13) 

这里是describe():

 { AlertPollingService: { AlertPollingService: { getManagementModule: [Object], getEMConfig: [Object], getAlertSnapshot: [Object], getAlertSnapshots: [Object], getManagedModules: [Object], getAllIscopeManagmentModules: [Object], getAllFilteredIscopeManagmentModules: [Object], getAllAlertsSnapshot: [Object], getAllAlertsSnapshotForManagementModule: [Object], getAgentSnapshot: [Object], getAgentSnapshots: [Object] } } } 

如果我运行下面的代码,它工作正常。 我还将包含来自SoapUI的soap请求:

 var args = {manModuleName: 'MQ'} soap.createClient(url, function(err, client) { console.log(client.describe()); client.getManagementModule(args, function(err, result) { console.log(result); }); }); ### SOAPUI REQUEST ### <soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:aler="http://alerts.hidden.server.hidden.com"> <soapenv:Header/> <soapenv:Body> <aler:getManagementModule soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <manModuleName xsi:type="xsd:string">MQ</manModuleName> </aler:getManagementModule> </soapenv:Body> </soapenv:Envelope> 

所以这个函数工作正常,因为我能够传递一个参数。 但是,下面的代码与上述错误失败。 您可以从soapui请求中看到没有任何理由。 这只是一个函数调用,返回一个列表。 我试过设置空白参数,空参数等…不能得到它的工作。

 soap.createClient(url, function(err, client) { console.log(client.describe()); client.getManagedModules(function(err, result) { console.log(result); }); }); ### SOAPUI REQUEST ### <soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:aler="http://alerts.hidden.server.hidden.com"> <soapenv:Header/> <soapenv:Body> <aler:getManagedModules soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </soapenv:Body> </soapenv:Envelope> 

任何想法,我怎么能得到这个工作?

我有一段时间的痛苦 – 我成功地定义args为'空':

 soap.createClient(url, function(err, client) { console.log(client.describe()); client.getManagedModules(null, function(err, result) { console.log(result); }); });