1

我正在使用节点肥皂库。我的项目从服务器端使用soap 1.2 版。

问题是当我向客户端响应消息时。

我在 node-soap 库中进行了调试,我看到 soap 的命名空间是硬编码的。这是来自 node-soap, server.js 文件的代码。

Server.prototype._envelope = function (body, includeTimestamp) {
  var defs = this.wsdl.definitions,
    ns = defs.$targetNamespace,
    encoding = '',
    alias = findPrefix(defs.xmlns, ns);
  var xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
    "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" " +
    encoding +
    this.wsdl.xmlnsInEnvelope + '>';
  var headers = ''; inc...

你可以看到soap命名空间的声明是xmlns:soap=\" http://schemas.xmlsoap.org/soap/envelope/ \"

现在,我将此特定代码更改为:

xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope/\"

它有效。

在这个库中有解决问题的最佳方法吗?(比如选项??)(比如forcesoap12headers:true在客户端[它工作得很好])

谢谢你的帮助,爱丽儿

4

0 回答 0