3

我正在对服务进行肥皂调用,但无法弄清楚如何正确格式化和发送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>

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

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

它以包含查询结果的 xml 进行响应。

我无法弄清楚我做错了什么或如何正确发送 EXECSQL 方法的参数。

任何帮助将不胜感激!

4

0 回答 0