dpigera
dpigera

Reputation: 3369

NodeJS Sending a HTTPS SOAP Request

I'm trying to send a SOAP request at a specific end point using nodejs.

My request looks like this:

<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>

I also have an https endpoint (e.g. https://hostname.com/box/) and a WSDL file.

Can someone please advise me of the best way to do this? I was looking through milewise/node-soap and can't seem to find a spot to enter my required endpoint.

Upvotes: 1

Views: 4497

Answers (1)

NotJustClarkKent
NotJustClarkKent

Reputation: 1095

You can specify the endpoint as part of the options:

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

Upvotes: 3

Related Questions