您的位置:首页 > 理论基础 > 计算机网络

BasicHttpBinding 和 Https 结合,手工编程实现

2012-06-07 22:11 411 查看
虽然用config文件可以轻松实现BasicHttpBinding 和 Https,但是如果是一个库的话,最好手工编程实现,这样不用把config文件拷来拷去。

BasicHttpBinding binding = new BasicHttpBinding();
binding.Security.Mode = BasicHttpSecurityMode.Transport;
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.None;
binding.MaxReceivedMessageSize = 10 * 1024 * 1024;
EndpointAddress ep = new EndpointAddress(url);
PortalServiceSoap proxy = ChannelFactory<PortalServiceSoap>.CreateChannel(binding, ep);
quoteReturn = proxy.WebMethod(requestObject);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐