HTTPS绑定对象 [英] HTTPS Binding Object

查看:108
本文介绍了HTTPS绑定对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个目前通过HTTP使用Web服务的应用程序。它是在不使用app.config的情况下编码的。所有绑定代码都使用BasicHttpBinding对象在C#代码中。我现在需要更改此应用程序以通过HTTPS使用相同的Web服务。是否有相应的HTTPS绑定对象,我找不到?我真的想在没有app.config的情况下设置它。任何帮助将不胜感激。

I have an application that is currently consuming a web services over HTTP. It is coded without using an app.config. All the binding code is in the C# code using a BasicHttpBinding object. I now have a need to change this application to consume the same web service over HTTPS. Is there a corresponding HTTPS binding object that I am not finding? I really want to set this up without an app.config it possible. Any help would be greatly appreciated.

推荐答案

更新 - 我想出了如何使这项工作。我现在使用HttpsTransportBindingElment来查看我想要的属性,然后将其添加到我现在用来代替BasicHttpBinding对象的CustomBinding对象,而不是使用BasicHttpBinding。这似乎可以解决问题......
UPDATE - I figured out how to make this work. Instead of using the BasicHttpBinding, I am now using an HttpsTransportBindingElment to see the properties I want and then adding that to a CustomBinding object that I now use in place of the BasicHttpBinding object. This seems to do the trick...


这篇关于HTTPS绑定对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆