basicHttpBinding同时使用和不使用ssl

时间:2014-02-14 00:03:14

标签: wcf ssl basichttpbinding

我在IIS上托管的WCF服务与使用SSL的https完美配合。它具有以下简单的绑定设置......

<system.serviceModel>
   <bindings>
      <basicHttpBinding>
         <binding maxBufferSize="524288" 
                  maxBufferPoolSize="1048576" 
                  maxReceivedMessageSize="524288">
            <readerQuotas maxStringContentLength="262144" maxArrayLength="65536" />
            <security mode="Transport">
               <transport clientCredentialType="None" />
             </security>        
         </binding>
      </basicHttpBinding>
   </bindings>
</system.serviceModel>

是否可以使用另一个basicHttpBinding但没有安全模式,以便客户端可以使用http或https连接。我只是复制并粘贴绑定并删除副本上的安全模式吗?或者这会引起混淆,因为有两个相同类型的绑定,但它们没有名称?

1 个答案:

答案 0 :(得分:0)

您必须创建另一个绑定并添加其他端点以使用没有安全性的绑定。绑定只是描述应该如何创建端点,但绑定配置不会打开任何端点。您可以使用相同的绑定使用多个端点,但每个端点只能使用一个绑定。