node.js – 如何通过节点js使用wsdl webservice

前端之家收集整理的这篇文章主要介绍了node.js – 如何通过节点js使用wsdl webservice前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在使用strong-soap节点模块我想调用webservice,我有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 ??
});

解决方法

我不确定肥皂的效果如何.
但是,我有一些使用 node-soap的SOAP实现

基本上,node-soap包使用Promises来保持请求的统一性.

var soap = require('soap');
  var url = 'http://www.webservicex.net/whois.asmx?WSDL';
  var args = {name: 'value'};
  soap.createClient(url,client) {
      client.GetWhoIS(args,result) {
          console.log(result);
      });
  });
原文链接:https://www.f2er.com/nodejs/241291.html

猜你在找的Node.js相关文章