【发布时间】:2015-05-09 12:25:27
【问题描述】:
我想在 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
但它没有工作!我该如何解决我的问题?
【问题讨论】:
-
查看我对这个问题的回答stackoverflow.com/a/63351804/1370029
标签: node.js web-services wcf soap wsdl