Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between BasicHttpsBinding and WsHttpBinding with Transport security?

As BasicHttpsBinding is new at .net 4.5, I don't seem to be able to find much stuff around differences between the two.

like image 267
dqm Avatar asked Feb 14 '13 12:02

dqm


People also ask

What is difference between WsHttpBinding and BasicHttpBinding?

Primarily BasicHttpBinding is designed to exchange SOAP over HTTP(s) only, just like old ASMX or . net web services and supports the WS-I BasicProfile. WsHttpBinding supports the advanced WS-* specification which includes WS-Addressing and WS-Security etc.

What is Basichttpsbinding?

BasicHttpBinding is suitable for communicating with ASP.NET Web Service (ASMX) based services that conform to the WS-Basic Profile that conforms with Web Services. This binding uses HTTP as the transport and text/XML as the default message encoding. Security is disabled by default.

What is the default security mode for WsHttpBinding in WCF?

The default is Message . - This attribute is of type SecurityMode.

How transport security is implemented in WCF?

The transport security for this binding is Secure Sockets Layer (SSL) over HTTP, or HTTPS. To create an WCF application that uses SSL, use IIS to host the application. Alternatively, if you are creating a self-hosted application, use the HttpCfg.exe tool to bind an X. 509 certificate to a specific port on a computer.


1 Answers

Indeed the two bindings are very similar. The only real difference is that to require HTTPS, the endpoint needed to be configured with a BasicHttpBinding in which you define the security mode as Transport (or any of the other valid enumerations). With a BasicHttpsBinding on the endpoint, the security mode is defaulted to Transport and the client credential type is set to None.

So here was your configuration before WCF 4.5:

<system.serviceModel>   <bindings>     <basicHttpBinding>       <binding name="Service.BasicHttp.BindingConfig">         <security mode="Transport" />               </binding>     </basicHttpBinding>   </bindings>   <services>     <service name="ServiceImpl">       <endpoint address="" binding="basicHttpBinding" bindingConfiguration="Service.BasicHttp.BindingConfig"                 name="IService.Http" contract="IService">       </endpoint>     </service>   </services> </system.serviceModel> 

With WCF 4.5, the same configuration can be simplified to:

<system.serviceModel>   <services>     <service name="ServiceImpl">       <endpoint address="" binding="basicHttpsBinding" name="IService.Http" contract="IService">   </endpoint> </service>   </services> </system.serviceModel> 

See What’s new in WCF 4.5? BasicHttpsBinding for additional detail.

like image 160
Philippe Avatar answered Sep 24 '22 23:09

Philippe