我正在创建一个API,以使用nodejs和node-soap访问具有身份验证的Soap Web服务器。 遵循node-soap开发人员npm中的文档,但是在访问webservice方法时返回错误。 {错误:套接字挂断代码:'ECONNRESET'} 禁止显示网址数据,证书,密码和查询方法。
const url = myurl
const WSDLoptions = {
wsdl_options: {
forever: true,
rejectUnauthorized: false,
strictSSL: true,
pfx: fs.readFileSync(__dirname + '/mycert.pfx'),
passphrase: '*****'
}
};
soap.createClient(url, WSDLoptions, function (err, client) {
if (err) console.log(err);
console.log(client);
client.Query(xml,function (err, res){
if (err)
console.log(err,res)
console.log(res)
})
});
{ Error: socket hang up
at createHangUpError (_http_client.js:330:15)
at TLSSocket.socketOnEnd (_http_client.js:431:23)
at TLSSocket.emit (events.js:202:15)
at endReadableNT (_stream_readable.js:1132:12)
at processTicksAndRejections (internal/process/next_tick.js:76:17) code: 'ECONNRESET' } undefined undefined undefined
undefined