Wednesday, 9 April 2014

Difference between BasicHttpBinding and WsHttpBinding

Difference between BasicHttpBinding and WsHttpBinding
Microsoft Windows Communication Foundation comes with a set of built-in bindings and each binding is designed to fulfill some specific need. So, if interoperability is our concern and we need to communicate with non-WCF system, then, we should go for basicHttpBinding or wsHttpBinding. Although these two bindings can work with WCF specific systems as well. But there are many differences between the two bindings. 


BasicHttpBinding is a WS-I Basic Profile [1] binding; it does not implement any advanced WS-* specs and sticks with SOAP over HTTP(S).  Due to the binding's simplicity it enables a higher level of interoperability with existing web service client and services.
The WSHttpBinding implements the advanced WS-* specs  including WS-Addressing and WS-Security enabling for more advanced messaging scenarios but also reduces the reach of your services and clients.
The reason you are probably seeing the perf gain with the BasicHttpBinding is because it is disables security by default while the WSHttpBinding has security enabled by default.
BasicHttpBinding only supports confidentiality through SSL at the transport level.
WSHttpBinding supports it both at the transport level (SSL) and at the message level (WS-Security).

1. Allows you to use various WS-* specifications such as
WS-Security 1.1, WS-Reliable Messaging etc
2. It supports SOAP 1.2 as a messaging protocol
3. As its built using WS-* specifications, it does not support
wider ranges of client.

WSHttpBinding more secure and reliable than BasicHttpBinding. Finally, if compatibility is not required, WSHttpBinding is the choice.

 
Following table explains the difference between BasicHttpBinding and WsHttpBinding.

BasicHttpBinding
WsHttpBinding
1
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.
2
It has higher level of interoperability with existing services and clients.
Due to more advanced messaging scenarios, it has reduced support for wider range of older clients.
3
BasicHttpBinding is based on SOAP 1.1 specification.
WsHttpBinding supports SOAP 1.2 specification.
4
No support for reliable Messaging.
Supports for reliable messaging.
5
No support for transactions.
It supports atomic and distributed transactions.
6
It has fewer security options. Or we can say, there is no security provided, by default, for BasicHttpBinding.
Because WsHttpBinding supports advanced WS-* specification, it has a lot more security options available. For example, It provides message-level security i.e. message is not sent in plain text. Also it supports for WS-Trust and WS-Secure conversation.
7
At transport level, it provides support for confidentiality through SSL.
It supports for both Transport as well as Message level security.
8
BasicHttpBinding is a bit faster because security is disabled by default.
As it supports advanced security options and its enabled by default, so it’s a bit slower than BasicHttpBinding.

No comments:

Post a Comment