2013-05-11 184 views
1

我想使用nodejs在特定的終點發送SOAP請求。NodeJS發送一個HTTPS 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文件。

有人可以告訴我這樣做的最好方法嗎?我正在通過milewise/node-soap尋找,似乎無法找到一個地方進入我所需的端點。

回答

1

您可以指定端點的選項的一部分:

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