无法将WCF服务绑定到nodeJS

时间:2017-03-08 10:15:45

标签: node.js wcf soap wsdl basichttpbinding

我正在尝试将我在本地创建的wcf服务绑定到nodeJs,但无法从下面的代码中获取响应。

在server.js中:

 var BasicHttpBinding = require('wcf.js').BasicHttpBinding
          , Proxy = require('wcf.js').Proxy
          , binding = new BasicHttpBinding()
          , proxy = new Proxy(binding, "http://localhost:56986/Service1.svc")
          ,message = '<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">'+
                          '<s:Header>'+
                          '<Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">"http://localhost:56986/IService/GetData</Action>'+
                          '<s:Header/>'+
                          '<s:Body>'+
                          '<GetData xmlns="http://tempuri.org/">'+
                          '<value>300</value>'+
                          '</GetData>'+
                          '</s:Body>'+
                          '<s:Envelope/>'
        proxy.send(message, "http://localhost:56986/IService/GetData", function(response, ctx) {
          console.log(message)
          console.log(response)
           console.log('done inside');
        });


         console.log('done');

    };

WCF服务: enter image description here

控制台输出: enter image description here

console.log(ctx)输出: enter image description here

0 个答案:

没有答案