Difference between Basic HTTP Binding and Net TCP Binding in WCF Service

Juval Lowy’s book said – “A binding is merely a consistent, canned set of choices regarding the transport protocol, message encoding, communication pattern, reliability, security, transaction propagation, and interoperability.”
Basic HttpBinding – HttpBinding is based on  HTTP protocol. It is compatiable with Web Service Technology and SOAP standard, which are heavier than TCP protocols. To make is SOAP compatible you need to write lot of header and extra stuff. More over you are working on a higher level of network layer when working with HTTP protocol, so there is some overhead as well. Main features are uses WS-I Basic Profile 1.1 standart mainly used for consuming the old ASMX WebServices. Other important features, you must pay attention on:

  1. Works over http protocol
  2. Supports security according to BasicHttpSecurityElement (None/Transport/Message/TransportWithMessageCredential/TransportCredentialOnly)
  3. Supports message encoding with Mtom (Message Transmission Organization Mechanism 1.0 (MTOM) encoder), used for tranfer of messages with large binary attachments

NetTcpBinding – Net.tcp is based on TCP protocol. Basically it is a TCP. This is most efficient binding and should be used in service to service communication. Main features are uses WS-* standart (has more features then WS-I Basic Profile 1.1) for deploying and consuming of the .NET WCF services in cross-machine communication environment. Other important features:

  1. Works over tcp protocol
  2. Supports security according to NetTcpSecurityElement (None/Transport/Message/Both)
  3. Supports transactions
  4. Supports reliable sessions (can support exactly-once delivery assurances)
Binding Protocol/Transport Message Encoding Security Default Session Transaction Duplex
BasicHttpBinding Http, Https Text None No
NetTcpBinding TCP Binary Transport Optional Yes Yes

 

Tagged . Bookmark the permalink.

Leave a Reply