我想在node.js中使用wcf。我試了一下:如何在node.js中使用wcf?
soap.createClient(url, function (err, client) { if (err) { console.log(err); return false; } client.myFunc(args, function(err1, result) { if(result.success) return true; }); });
但createClient(誤差塊)發生了錯誤。它說:WSDL或包含的意外根元素。 然後我試圖通過wcf.js:
var BasicHttpBinding = require('wcf.js').BasicHttpBinding
, Proxy = require('wcf.js').Proxy
, binding = new BasicHttpBinding()
, proxy = new Proxy(binding, " http://localhost/myService.svc");
var message = '<Envelope xmlns=' +
'"http://schemas.xmlsoap.org/soap/envelope/">' +
'<Header />' +
'<Body>' +
'<myFunc xmlns="http://localhost/myService.svc/">' +
'<value>'+ args +'</value>' +
'</AddNewUser>' +
'</Body>' +
'</Envelope>';
proxy.send(message, "http://localhost/myService.svc", function (result, ctx){
if(result.success)
return true;
});
但我的程序沒有調用發送功能。 最後我試圖配置WCF到WSDL發佈是這樣的:WCF cannot configure WSDL publishing
但它沒有奏效!我如何解決我的問題?