我希望有一个WCF服务,支持HTTP或HTTPS。Link1和link2非常有用,我设法修改了web.config,使其同时适用于HTTPS和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也将停止工作(或者反过来)。这个问题能解决吗?
发布于 2018-03-11 16:39:32
只有http绑定配置将如下所示:
<service name="Service">
<endpoint address="" contract="IService" binding="webHttpBinding" bindingConfiguration="wbBind" behaviorConfiguration="web" />
</service>
<binding name="wbBind"/>请记住,您应该更改web配置,以便只有http或https绑定。
https://stackoverflow.com/questions/49197682
复制相似问题