0

这听起来像是一个重复的问题,但是在使用适用于 Nodejs 的 soap npm 包访问 SOAP 服务时,它在 localhost 或直接使用 SOAP UI 请求 .asmx url 时完美运行,但是当代码(基于 Nodejs 的)实时部署时服务器,它在加载 1 分钟后返回 502 Bad gateway 响应。(ErrConn-连接超时)。这是代码结构-

肥皂服务.js 文件

// All imports done
async function getStudent (id){
soap.createClient('./student.wsdl', endpoint, (err, client) => {
client.setSecurity(new soap.BasicAuthSecurity..)
client.addSoapHeader(soapHeader),
client.addHttpHeader('SOAPAction', 'https://...'),
client.displayStudent({id}, (err, res) => {
if(err){
// Do something, return
}
return resolve (res)
})
}
soap.http....
..
}

它在标题中也有用户名和密码,在本地主机上工作正常,但在实时服务器上不工作。

我在 router.post route(expressJs) 中调用这个 getStudent(studentId) 方法。

4

0 回答 0