NodeJS发送HTTPS SOAP请求 [英] NodeJS Sending a HTTPS SOAP Request

查看:432
本文介绍了NodeJS发送HTTPS SOAP请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用nodejs在特定的端点发送SOAP请求.

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

我的请求如下:

<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 文件.

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

有人可以告诉我这样做的最佳方法吗?我正在浏览 milewise/node-soap ,但似乎找不到找到我的地点必需的端点.

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.

推荐答案

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

You can specify the endpoint as part of the options:

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

这篇关于NodeJS发送HTTPS SOAP请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆