【发布时间】:2018-03-09 16:04:51
【问题描述】:
我想要一个支持 HTTP 或 HTTPS 的 WCF 服务。 Link1 和 link2 非常有帮助,我设法修改 web.config 以适用于 HTTP 和 HTTPS
<service name="Service">
<endpoint address="" contract="IService" binding="webHttpBinding" bindingConfiguration="wbBind" behaviorConfiguration="web" />
<endpoint address="" contract="IService" binding="webHttpBinding" bindingConfiguration="wbsBind" behaviorConfiguration="web" />
</service>
<binding name="wbBind">
<security mode="None"></security>
</binding>
<binding name="wbsBind">
<security mode="Transport"></security>
</binding>
当我有两个 IIS 绑定时,这工作得很好 Site bindings
但如果我删除其中一个绑定(例如 http) Only https binding
那么 https 也将停止工作(或相反)。这可以解决吗?
【问题讨论】:
标签: c# web-services wcf web-config