NodeJS发送HTTPS SOAP请求

我试图使用nodejs在特定的终点发送一个SOAP请求。

我的请求如下所示:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://company.com/nse/types"> <soapenv:Header/> <soapenv:Body> <typ:Login> <!--You have a CHOICE of the next 2 items at this level--> <typ:Credential userName="x" password="y"/> </typ:Login> </soapenv:Body> </soapenv:Envelope> 

我也有一个https端点 (例如https://hostname.com/box/ )和一个WSDL文件。

有人可以告诉我这样做的最好方法吗? 我正在通过英里/节点肥皂寻找,似乎无法find一个地方进入我所需的端点。

您可以将端点指定为选项的一部分:

 var soap = require( 'soap' ); soap.createClient( ep.wsdl, { endpoint : ep.uri }, function( err, client ) { ... });