Friday, November 25, 2011

Comparison of various bindings in WCF

In my previous post I had discussed the differences between WCF and Web-Services. In this post I am going to show the difference between the various bindings in the WCF.


Class name
Description
Transport
Message encoding
Security
BasicHttpBinding
A binding that is suitable for communication with WS-Basic Profile conformant Web Services like ASMX-based services. This binding uses HTTP as the transport and Text/XML as the message encoding.
HTTP
Text
None
WSHttpBinding
A secure and interoperable binding that is suitable for non-duplex service contracts.
HTTP
Text
Message
WSDualHttpBinding
A secure and interoperable binding that is suitable for duplex service contracts or communication through SOAP intermediaries.
HTTP
Text
Message
WSFederationHttpBinding
A secure and interoperable binding that supports the WS-Federation protocol, enabling organizations that are in a federation to efficiently authenticate and authorize users.
HTTP
Text
Message
NetTcpBinding
A secure and optimized binding suitable for cross-machine communication between WCF applications
TCP
Binary
Transport
NetPeerTcpBinding
A binding that enables secure, multi-machine communication.
P2P
Binary
Transport
NetNamedPipesBinding
A secure, reliable, optimized binding that is suitable for on-machine communication between WCF applications.
Named Pipes
Binary
Transport
NetMsmqBinding
A queued binding that is suitable for cross-machine communication between WCF applications.
MSMQ
Binary
Message
MsmqIntegrationBinding
A binding that is suitable for cross-machine communication between a WCF application and existing MSMQ applications.
MSMQ
doesn’t use a WCF message encoding – instead it lets you choose a pre-WCF serialization format
Transport




Further the most commonly used binding are BasicHttpBinding and WsHttpBinding. The difference between these two is as follows:
Criteria
BasicHttpBinding

WsHttpBinding   

Security support
This supports the old ASMX style, i.e. WS-BasicProfile 1.1.
This exposes web services using WS-* specifications.
Compatibility
This is aimed for clients who do not have .NET 3.0 installed and it supports wider ranges of clients. Many of the clients like Windows 2000 still do not run .NET 3.0. So older version of .NET can consume this service.
As its built using WS-* specifications, it does not support wider ranges of client and it cannot be consumed by older .NET version less than 3 version.
Soap version
SOAP 1.1
SOAP 1.2 and WS-Addressing specification.
Reliable messaging
Not supported. In other words, if a client fires two or three calls you really do not know if they will return back in the same order.
Supported as it supports WS-* specifications.
Default security options
By default, there is no security provided for messages when the client calls happen. In other words, data is sent as plain text.
As WsHttBinding supports WS-*, it has WS-Security enabled by default. So the data is not sent in plain text.
Security options
  • None
  • Windows – default authentication
  • Basic
  • Certificate
  • None
  • Transport
  • Message
  • Transport with message credentials

The following video will make this more clear:



LinkWithin

Related Posts with Thumbnails