node-soap如何使用soap 1.2版

时间:2016-12-27 08:18:30

标签: soap soapserver node-soap

我正在使用node-soap库。 我的项目从服务器端使用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 [效果极佳])

感谢您的帮助, 爱丽儿

0 个答案:

没有答案
相关问题