简体   繁体   中英

basicHttpBinding with and without ssl at the same time

I have a WCF service hosted on IIS that is working perfectly well over https with SSL. It has the following simple binding setup...

<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>

Is it possible to have another basicHttpBinding but without the security mode so that clients can connect with http or https. Do I just copy and paste the binding and remove the security mode on the copy? Or will that cause confusion because there are two bindings of the same type but they do not have names?

You have to create another binding and add an additional endpoint to use the binding without security. A binding is only a description HOW an endpoint should be created, but the binding configuration does not open any endpoints. You can have many endpoints using the same binding, but only one binding per endpoint.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM