我想在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
但它没有奏效!我如何解决我的问题?