我想要一个支持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也将停止工作(或反过来)。这可以修复吗?
答案 0 :(得分:0)
只有http绑定配置如下:
<service name="Service">
<endpoint address="" contract="IService" binding="webHttpBinding" bindingConfiguration="wbBind" behaviorConfiguration="web" />
</service>
<binding name="wbBind"/>
请记住,您应该更改网络配置,以便只拥有http或https绑定。