我正在尝试将我在本地创建的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');
};