WCF > Web Service: basicHttpBinding vs netTcpBinding


I'm trying to understand the basic of WCF, when I came across following question:

Why use basicHttpBinding over netTcpBinding for a web service?

Both of them can have a mex endpoint which allows you to add both of them easily through the Add Server Reference window, without any configuration at all?

I'm aware of that the HTTP Protocol is built on top of the TCP Protocol, however to me it just looks like that HTTP provides a lot of unessecary boilerplate (perfomance etc.)

Could anyone please clarify why you would choose one over the other for a web service?

Best Solution

It has all todo with capabilities, compatability, security and performance

It boils down to: use netTcp if you're clients support WCF and are on your intranet.

use basicHtpp if you need to support 'older' (asmx) or 'compatible' (java/rails/pythone) clients, which might be on the internet.

See: http://msdn.microsoft.com/en-us/library/ff649887.aspx