我正在对服务进行肥皂调用,但无法弄清楚如何正确格式化并发送我想要使用的client.method
的参数/参数。
client.describe()
给了我这个:
{ SysGestAgentApi:
{ SysGestAgentApiSoapPort:
{ EXECSQL: [Object]
....还有更多,但这个EXECSQL是我想要使用的方法。 此方法将SQL查询作为字符串的唯一参数。
我试过的是:
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>
P.S。在PHP中我做得非常简单:
$client = new SoapClient($url);
$response_xml_2 = $client->EXECSQL("SELECT * FROM _33NWEB");
并以包含查询结果的xml进行响应。
我无法弄清楚我做错了什么或如何正确发送EXECSQL方法的参数。
非常感谢任何帮助!