I am trying to use wsdl from node. Using 'vpulim / node -soap'.
I can load wsdl, describe it, and even call certain functions. However, at any time when I try to call a function that does not expect any arguments, I get an error:
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)
Here is the description ():
{ AlertPollingService:
{ AlertPollingService:
{ getManagementModule: [Object],
getEMConfig: [Object],
getAlertSnapshot: [Object],
getAlertSnapshots: [Object],
getManagedModules: [Object],
getAllIscopeManagmentModules: [Object],
getAllFilteredIscopeManagmentModules: [Object],
getAllAlertsSnapshot: [Object],
getAllAlertsSnapshotForManagementModule: [Object],
getAgentSnapshot: [Object],
getAgentSnapshots: [Object] } } }
If I run the following code, it works fine. I will also include a soap request from SoapUI:
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>
So this function works fine, because I can pass arg. However, the following code does not work with the error above. From the soapui query, you can see that no arguments are expected. This is just a function call that returns a list. I tried setting empty args, null args etc ... can't make it work.
soap.createClient(url, function(err, client) {
console.log(client.describe());
client.getManagedModules(function(err, result) {
console.log(result);
});
});
<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>
Any ideas on how I can make this work?