views:

5195

answers:

3

I'm new to WCF and would like to know the differences/advantages/limitations/etc of each of the following bindings:

net.pipe
net.tcp
http

Supporting scenarios on when to use each binding and other examples would be appreciated.

+3  A: 

Windows Communication Foundation (WCF) is a framework for building services that process XML messages. WCF allows you to transmit messages using different transport protocols (such as HTTP, TCP, and MSMQ) and using different XML representations (such as text, binary, or MTOM, which is commonly referred to as the message encoding in WCF.

If you want to host many WCF Services on one machine and want them to use shared memory for their communication, use a named pipe=>net.pipe, and then use tcp for the communication to WCF Services on different machines.

Configuration of nettcp binding focuses on creating a channel stack that will perform better in Windows environments, giving you a great option for replacing your various COM+ and .NET remoting investments.

BasicHttpBinding was designed for scenarios where interoperability is of utmost importance. As a result, BasicHttpBinding uses HTTP for the transport and text for the message encoding.

CodeToGlory
+6  A: 

net.pipe, fast and secure because your web service is not accessible from the network (typically, you will use net.pipe to interact with a windows service easily).

http, you will use it for interoperability reason, if your web service is not over HTTP, silverlight or flash cannot use it (because the browser filter non-http packets, as a firewall does).

net.tcp, is a bit faster because your soap message is not wrapped inside a HTTP request, but you cannot invoke your webservice with a RIA technology, and some firewall will drop your message.

Nicolas Dorier
+5  A: 

While not great for providing specific usage examples, here is a link from MSDN which lists all the features for the bindings.

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

Here is a decent flow chart that can help choosing between them as well.

http://bloggingabout.net/blogs/dennis/archive/2006/12/01/WCF-Binding-decision-chart.aspx

Here is a good overall article I've used in the past.

http://mkdot.net/blogs/dejan/archive/2008/03/31/wcf-binding-decision.aspx

Joe Doyle