【问题标题】:express.js and soap callsexpress.js 和肥皂调用
【发布时间】:2013-09-18 17:55:28
【问题描述】:

我正在使用 express.js、node.js 和 node-soap.js,但我遇到了一个无法修复的错误。

我的以下代码因异常而失败,我在异常中看不到任何内容。

var soap = require('soap');
var url = 'http://www.webservicex.net/stockquote.asmx?WSDL';

var args = {
    symbol : 'AMZN'
};

soap.createClient(url, function(err, client) {
    client.GetQuote(args, function(err, result) {
        if (err) {
            console.log(err);
            return;
        }

        console.log(result);
    });
});

在控制台中我看到的是:

{ GetQuoteResult: [ 'exception' ] }

想法?

雷扎

【问题讨论】:

    标签: javascript node.js soap express


    【解决方案1】:

    这是终于开始工作的代码......

    var args1 = {"tns:symbol": "AMZN"};
    var url1 = "http://www.webservicex.net/stockquote.asmx?WSDL";
    soap.createClient(url1, function(err, client) {
        console.log(client.describe().StockQuote.StockQuoteSoap.GetQuote);
        client.StockQuote.StockQuoteSoap.GetQuote(args1, function(err, result) {
            if (err) {
                console.error(err);
                return;
            }
            console.log(result);
        });
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-01-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多