首页 > Web开发 > 详细

在 Node.js 上调用 WCF Web 服务

时间:2015-12-05 22:19:54      阅读:197      评论:0      收藏:0      [点我收藏+]
var BasicHttpBinding = require(‘wcf.js‘).BasicHttpBinding  , 
Proxy = require(‘wcf.js‘).Proxy ,
binding = new BasicHttpBinding(
{ SecurityMode: "TransportWithMessageCredential"
, MessageClientCredentialType: "UserName"
}) , proxy = new Proxy(binding, "http://localhost:7171/Service/clearUsername") ,
message = "<Envelope xmlns=‘http://schemas.xmlsoap.org/soap/envelope/‘>" +
"<Header />" +
"<Body>" +
"<GetData xmlns=‘http://tempuri.org/‘>" +
"<value>123</value>" +
"</GetData>" +
"</Body>" +
"</Envelope>"proxy.ClientCredentials.Username.Username = "yaron"proxy.ClientCredentials.Username.Password = "1234"proxy.send(message,
"http://tempuri.org/IService/GetData",
function(response, ctx) {
console.log(response)});

在 Node.js 上调用 WCF Web 服务

原文:http://www.cnblogs.com/wonglu/p/5022337.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!