Tag: node soap

节点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 […]

使用node-soap发送正确的soap请求

我正在面对一个非常恼人的问题发送肥皂请求。 如果我使用像SOAP-UI这样的工具,我可以轻松地在XML中构build适当的soap请求。 但是,如果我试图使用节点肥皂发送此肥皂请求我无法得到正确的xmlstring… 我不知道为什么,但node-soap插件将string“SoapIn”附加到方法名称(GetArrBoardWithDetail)。 看下面的代码片段: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://thalesgroup.com/RTTI/2017-02-02/ldb/" xmlns:tok="http://thalesgroup.com/RTTI/2013-11-28/Token/types" xmlns:ct2007="http://thalesgroup.com/RTTI/2007-10-10/ldb/commontypes" xmlns:ct2015="http://thalesgroup.com/RTTI/2015-11-27/ldb/commontypes" xmlns:ldbt2017="http://thalesgroup.com/RTTI/2017-02-02/ldb/types"> <soapenv:Header> <tok:AccessToken> <tok:TokenValue>asdf</tok:TokenValue> </tok:AccessToken> </soapenv:Header> <soapenv:Body> <tns:**GetArrBoardWithDetailsSoapIn**> <tns:numRows>50</tns:numRows> <tns:crs>ACY</tns:crs> <tns:filterCrs></tns:filterCrs> <tns:filterType>to</tns:filterType> <tns:timeOffset>0</tns:timeOffset> <tns:timeWindow>120</tns:timeWindow> </tns:**GetArrBoardWithDetailsSoapIn**> </soapenv:Body> </soapenv:Envelope> 外部工具SoapUI不会附加像“SoapIn”这样的string。 肥皂用户界面附加string“Request”(请参阅​​下面的代码片段)。 <?xml version="1.0" encoding="utf-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://thalesgroup.com/RTTI/2017-02-02/ldb/" xmlns:tok="http://thalesgroup.com/RTTI/2013-11-28/Token/types" xmlns:ct2007="http://thalesgroup.com/RTTI/2007-10-10/ldb/commontypes" xmlns:ct2015="http://thalesgroup.com/RTTI/2015-11-27/ldb/commontypes" xmlns:ldbt2017="http://thalesgroup.com/RTTI/2017-02-02/ldb/types"> <soapenv:Header> <tok:AccessToken> <tok:TokenValue>asdf</tok:TokenValue> </tok:AccessToken> </soapenv:Header> <soapenv:Body> <tns:**GetArrBoardWithDetailsRequest**> <tns:numRows>50</tns:numRows> <tns:crs>ACY</tns:crs> <tns:filterCrs></tns:filterCrs> <tns:filterType>to</tns:filterType> <tns:timeOffset>0</tns:timeOffset> <tns:timeWindow>120</tns:timeWindow> […]