gpt4 book ai didi

javascript - 类型错误 : Cannot read property 'indexOf' of undefined in Nodejs

转载 作者:行者123 更新时间:2023-12-03 02:32:15 27 4
gpt4 key购买 nike

我刚刚开始使用 Node 学习 SOAP 客户端。在可用的软件包中,我决定使用 easy-soap npm 软件包 here在 Nodejs 中进行 SOAP 调用。

第一次尝试以错误告终。我在这里做错了什么?如何从这里继续前进。有人可以阐明这一点吗?

(function() {

"use strict";

var easysoap = require('easysoap');

// ##define soap params

var params = {
host : '190.100.00.00',
path : '/webservices/angular2/',
wsdl : '/webservices/angular2/php-server.wsdl',

// set soap headers (optional)
headers: [{
'name' : 'item_name',
'value' : 'item_value',
'namespace': 'item_namespace'
}]
}


// ##create the client


var soapClient = easysoap.createClient(params);



// ##get all available functions

soapClient.getAllFunctions()
.then((functionArray) => { console.log(functionArray); })
.catch((err) => { console.error(err); });


}

 **ERROR:**
TypeError: Cannot read property 'indexOf' of undefined
at doGetRequest.then (/home/user/test/node_modules/wsdlrdr/src/index.js:326:41)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)

最佳答案

而不是 .catch((err) => { throw new Error(err); });,

do .catch(err => console.error(err); ) 可以检查堆栈跟踪并查看错误来自哪一行。

如果是库问题,请在其 Github Repo 上提交新问题.

另请删除 Typescript 标签。

关于javascript - 类型错误 : Cannot read property 'indexOf' of undefined in Nodejs,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48688837/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com