我正在使用强soap节点模块,我想调用Web服务,我有wsdl文件。
var soap = require('strong-soap').soap;
var WSDL = soap.WSDL;
var path = require('path');
var options = {};
WSDL.open('./wsdls/RateService_v22.wsdl',options,
function(err, wsdl) {
// You should be able to get to any information of this WSDL from this object. Traverse
// the WSDL tree to get bindings, operations, services, portTypes, messages,
// parts, and XSD elements/Attributes.
var service = wsdl.definitions.services['RateService'];
//console.log(service.Definitions.call());
//how to Call rateService ??
});
2条答案
按热度按时间i34xakig1#
我不确定
strong-soap
是如何工作的,但是我有一些SOAP
的实现,使用node-soap。基本上,
node-soap
包使用Promises
来保持请求并发。qzlgjiam2#
让我们使用以下sample SOAP service:
按主机名/域名(WhoIS)获取域名注册记录
根据代码判断,您希望使用本地可用的**.wsdl**文件,因此保存该文件:
现在,让我们使用以下代码来查询它:
它将产生一些有意义的结果。您尝试使用的
WSDL.open
用于处理WSDL结构将WSDL加载到树形式中。遍历WSDL树以获取绑定、服务、端口、操作等。
调用服务不一定需要它