节点SOAP如何发送参数/参数与请求

我正在做一个服务的肥皂调用,但无法弄清楚如何正确格式化和发送参数/客户client.method ,我想使用的参数。

client.describe()给了我这个:

 { SysGestAgentApi: { SysGestAgentApiSoapPort: { EXECSQL: [Object] 

….以及更多,但是这个EXECSQL是我想要使用的方法。 此方法将SQL查询作为唯一参数作为string。

我试过的是这样的:

 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()); }); }); 

它一直在回应一个错误的XML,这是这样的:

 <?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> 

PS在PHP中,我做的非常简单:

 $client = new SoapClient($url); $response_xml_2 = $client->EXECSQL("SELECT * FROM _33NWEB"); 

并用包含查询结果的XML进行响应。

我无法弄清楚我在做什么错误,或者如何正确地发送EXECSQL方法的参数。

任何帮助将非常感激!