如何使用NTLM身份validation在节点js中调用SOAP webservice
我是NodeJS的新手,我需要一些帮助来连接到NTLM身份validation的SOAP Web服务。
执行此代码时,httpntlm模块中会显示一个错误:
C:\soapclient\node_modules\httpntlm\ntlm.js:106 callback(new Error("Couldn't find NTLM in the message type2 comming from the server")); ^ TypeError: callback is not a function at Object.parseType2Message (C:\soapclient\node_modules\httpntlm\ntlm.js:106:3) at sendType3Message (C:\soapclient\node_modules\httpntlm\httpntlm.js:66:23) at Immediate._onImmediate (C:\soapclient\node_modules\httpntlm\httpntlm.js:93:4) at processImmediate [as _immediateCallback] (timers.js:383:17)
和代码:
var soap = require('soap-ntlm-2'); var url ='https://ws.tmb.cat/secure/ws-ibus/IBusService?WSDL' var options = { wsdl_options: { ntlm: true, username: "xxxxxx", password: "xxxxxx" } }; soap.createClient(url, options, function (err, client, body) { if (err) { console.log("4") console.log(err); } client.setSecurity(new soap.NtlmSecurity(options.wsdl_options)); console.log(client.describe()); report = client.getAllArrivaltimes({}, function(err, res){ console.log('err='+err); console.log('res='+res); }); });
这是http-ntlm模块中的一个错误。
它不会传递callback
,因此在callback
时它是undefined
。
以下是GitHub上的相关错误: https : //github.com/SamDecrock/node-http-ntlm/issues/48
这里是解决这个问题的方法: https : //github.com/SamDecrock/node-http-ntlm/pull/51
- 用Googleloginlogin我的网站后获取谷歌帐户信息(用于login的卫星lib)
- 如何将“Auto Prefixer”合并到“package.json”和“grunt.js”中?
- 在ExpressJS中如何caching工作的说明
- 我可以使用node.js中的cheerio包加载本地html文件吗?
- 尝试交叉编译node.js for arm时出现错误的选项
- 在启动时启动tty.js
- 在gulp和nodejs中使用Typescript时需要和导出的未定义引用
- ValidationException:ExpressionAttributeValues不能为空
- 未find命令react-native和create-react-app(Mac OS)