WCF Different Types Of Bindings In WCF


What Is Binding In WCF?

Binding describes how a client is going to communicate to WCF service. Binding is used as per client need. It supports different types of protocol to communicate with client and different types of encoding to transfer the data over the internet. So, basically binding is nothing but it is a way of communication between client and service as per client need.

Binding

  • Describes how a service communicates
  • Specifies which protocol to be used
  • Specifies the encoding method to format the message contents
  • Specifies the security requirements
  • Specifies the message exchange format
  • Specifies the message session mode

There are different types of bindings available in WCF.

Binding Names Transposrt Encoding Interoperable
BasicHttpBinding HTTP/HTTPS Text/MTOM YES
NetTcpBinding TCP Binary NO
NetPeerBinding P2P Binary NO
NetNamedPipeBinding IPC Binary NO
WSHttpBinding HTTP/HTTPS Text/MTOM YES
WSFederationHttpBinding HTTP/HTTPS Text/MTOM YES
WSDualHttpBinding HTTP Text/MTOM YES
NetMsmqBinding MSMQ Binary NO
MsmqIntegrationBinding MSMQ Binary YES


BasicHttpBinding

It is useful when you are using ASP.NET Web service based service. It uses WS-basic web services component and uses HTTP as transport protocol and encoding as text or xml. Https is also used with this binding.
NetTcpBinding

It supports TCP as protocol and binary encoding by default. It provides cross machine communication and supports WS-ReliableMessaging by default. It provides more secure transfer and reliable communication.

NetPeerBinding

This binding uses secure communication between peer to peer environment when you need. It uses TCP as a protocol for communication. SOAP security and transaction are fully supported by this.

NetNamedPipeBinding

It uses NamedPipe protocol to communicate with client with full support of SOAP security and transaction. It also uses WS-ReliableMessaging for secure transfer of data over the network and delivering the data in binary encoding.

WSHttpBinding

It is more secure, reliable and interoperable as compared to basic http binding. It supports WS-* functionality and distributed transactions with reliable and secure sessions using SOAP security. WSHttpBinding uses both HTTP and HTTPS transport for communication.

WSFederationHttpBinding

Sometimes we need to add federated security service which helps us to implement federation which has the ability to share identities with multiple domains for authentication and authorization. It uses WS-federation protocol.

WSDualHttpBinding

It is same as WSHttpBinding rather than it supports duplex service. Duplex is a message pattern that is used by client and service to exchange their message via callback. In this binding reliable sessions are enabled by default.

NetMsmqBinding

It is used for queue communication. It means that this binding gives us secure and reliable queued communication for the cross machine environment. Uses MSMQ as transport protocol and provides reliable, robust and distributed application.

MsmqIntegrationBinding

This binding can be used to enable WCF applications to send and receive messages to and from existing MSMQ applications that use COM, native C++ APIs or the types defined in the System.Messaging namespace.

Advertisements

One comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s