I'm making a soap call to a service, but can't figure out how to correctly format and send arguments/parameters for the client.method
that I want to use.
The client.describe()
gives me this:
{ SysGestAgentApi:
{ SysGestAgentApiSoapPort:
{ EXECSQL: [Object]
....and a lot more, but this EXECSQL is the method I want to use. This method takes an SQL query as the only parameter as a string.
What I tried is this:
var soap = require('soap');
var url = 'http://ipaddress:port/sysgestagentapi/SysGestAgentApi.WSDL';
var args = 'SELECT * FROM _33NWEB';
soap.createClient(url, function(err, client) {
client.SysGestAgentApi.SysGestAgentApiSoapPort.EXECSQL(args, function(err, result) {
console.log(result.toJSON());
});
});
It keeps responding with an error XML, which is this:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<SOAP-ENV:Envelope
xmlns:SOAPSDK1="http://www.w3.org/2001/XMLSchema"
xmlns:SOAPSDK2="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAPSDK3="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Server</faultcode>
<faultstring>WSDLReader:None of the matching operations for soapAction http://tempuri.org/SysGestAgentApi/action/SysGestAgentApi.VERSIUNE could successfully load the incoming request. Potential typemapper problem</faultstring>
<detail>
<mserror:errorInfo
xmlns:mserror="http://schemas.microsoft.com/soap-toolkit/faultdetail/error/">
<mserror:returnCode>-2147024809 : The parameter is incorrect.\r\n</mserror:returnCode>
<mserror:serverErrorInfo>
<mserror:description>WSDLReader:None of the matching operations for soapAction http://tempuri.org/SysGestAgentApi/action/SysGestAgentApi.VERSIUNE could successfully load the incoming request. Potential typemapper problem HRESULT=0x80070057: The parameter is incorrect.\r\n - Server:One of the parameters supplied is invalid. HRESULT=0x80070057: The parameter is incorrect.\r\n</mserror:description>
<mserror:source>WSDLReader</mserror:source>
</mserror:serverErrorInfo>
<mserror:callStack>
<mserror:callElement>
<mserror:component>WSDLReader</mserror:component>
<mserror:description>None of the matching operations for soapAction http://tempuri.org/SysGestAgentApi/action/SysGestAgentApi.VERSIUNE could successfully load the incoming request. Potential typemapper problem</mserror:description>
<mserror:returnCode>-2147024809 : The parameter is incorrect.\r\n</mserror:returnCode>
</mserror:callElement>
<mserror:callElement>
<mserror:component>Server</mserror:component>
<mserror:description>One of the parameters supplied is invalid.</mserror:description>
<mserror:returnCode>-2147024809 : The parameter is incorrect.\r\n</mserror:returnCode>
</mserror:callElement>
</mserror:callStack>
</mserror:errorInfo>
</detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
P.S. In PHP I did it extremely simple:
$client = new SoapClient($url);
$response_xml_2 = $client->EXECSQL("SELECT * FROM _33NWEB");
and it responds with an xml containing the result of the query.
I can't figure out what am I doing wrong or how to correctly send the parameters for the EXECSQL method.
Any help would be very much appreciated!