使用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> </tns:**GetArrBoardWithDetailsRequest**> </soapenv:Body> </soapenv:Envelope> 

肥皂UI生成的请求正常工作。 有谁知道如何根据Soap-UI请求调整XMLstring的这一部分?

源代码:

 soap.WSDL.prototype.ignoredNamespaces = ['targetNamespace', 'typedNamespace']; // several options to modify the xml code of the soap request const wsdlOptions = { envelopeKey: 'soapenv', 'overrideRootElement': { 'namespace': 'tns', } }; // // creates the soapClient soap.createClient(wsdlUrl, wsdlOptions, function(err, client) { // adds the needed SoapHeader to the requests client.addSoapHeader(soapHeaderXML); // specific soap-request client.GetArrBoardWithDetails(soapParams, function(result, err) { var lRequest = client.lastRequest; var prettyLRequest = prettyData.xml(lRequest); console.log(prettyLRequest); console.log(result); }) }) 

最亲切的问候