Select WCF Binding
While I was reading this book Addison.Wesley.Essential.Windows.Communication.Foundation, I read very useful and important topic about WCF selects binding. so I would like to share this nice information to all.
Introduction
Actually there are nine preconfigured bindings in WCF, Each of these provides the means for a particular distributed computing need, there are several factors that determine which binding to choose for a specific application, including security, interoperability, reliability, performance, and transaction requirements. You can study these cases throw the below image.

Each of the bindings supports a particular communication scenario, such as cross- machine, on-machine, and interoperable communication using Web services; I will explain each communication scenario in details with very simple example.
netTcpBinding
The netTcpBinding binding is designed to support communication between .NET applications that are deployed on separate machines across a network, including communication across intranets and the Internet. This type of communication called cross-machine communication.
Address format: net.tcp://{hostname}[:port]/{service location}
Default port number:808
netTcpBinding Service Configuration
<services> <service name="EssentialWCF.Service1" behaviorConfiguration="EssentialWCF.Service1Behavior"> <host> <baseAddresses> <add baseAddress="net.tcp://localhost/EssentialWCF"/> </baseAddresses> </host> <endpoint address="" binding="netTcpBinding" contract="EssentialWCF.IService1"></endpoint> </service> </services>
netTcpBinding Client Configuration
<client> <endpoint address="net.tcp://localhost/Service1.svc" binding="netTcpBinding" contract="ServiceReference1.IService1"></endpoint> </client>
netNamedPipeBinding
WCF supports interprocess and intraprocess communication scenarios with the netNamedPipeBinding binding.the netNamedPipeBinding binding leverages a named pipes transport. This is a great binding to use for doing interprocess communication (IPC) because it provides a significant performance increase over the other standard bindings available in WCF.
This type of communication called Local machine communication.
Address format: net.pipe://{hostname}/{service location}
Default port number:808
<services> <service name="EssentialWCF.Service1" behaviorConfiguration="EssentialWCF.Service1Behavior"> <host> <baseAddresses> <add baseAddress="net.pipe://localhost/EssentialWCF"/> </baseAddresses> </host> <endpoint address="" binding="netNamedPipeBinding" contract="EssentialWCF.IService1"></endpoint> </service> </services>
basicHttpBinding
<client> <endpoint address="net.pipe://localhost/Service1.svc" binding="netNamedPipeBinding" contract="ServiceReference1.IService1"></endpoint> </client>
The basicHttpBinding binding offers support for Web service communication based on the WS-I Basic Profile 1.1 (WS-BP 1.1) specification. This includes standards such as SOAP 1.1, WSDL 1.1, and Message Security 1.0. This type of communication called web service communication.
Address format: http://{hostname}/{service location} and https://{hostname}/{service location}
Default port number:80 for http and 443 for https
basicHttpBinding Service Configuration
basicHttpBinding Client Configuration
<client> <endpoint address="http://localhost/Service1.svc" binding=" basicHttpBinding " contract="ServiceReference1.IService1"></endpoint> </client>
wsHttpBinding
The wsHttpBinding binding provides interoperable communication across heterogeneous platforms as well as advanced infrastructure level protocols, such as security, reliable messaging, and transactions. The wsHttpBinding binding is the default binding in .NET Framework 3.0 whenever you need interoperable communication based on Web services. This type of communication called Advanced web service communication.
Address format: http://{hostname}:{port}/{service location} and https://{hostname}:{port}/{service location}Default port number:80 for http and 443 for https
wsHttpBinding Service Configuration
wsHttpBinding Client Configuration
<client> <endpoint address="http://localhost/Service1.svc" binding=" wsHttpBinding " contract="ServiceReference1.IService1"></endpoint> </client>
ws2007HttpBinding
.NET Framework 3.5 introduces a new binding for Web service interoperability called the ws2007HttpBinding binding. This binding is similar to the
ws2007HttpBinding binding except that it supports the latest WS-* standards available for messaging, security, reliable messaging, and transactions.This type of communication called Advanced web service communication.
Address format: http://{hostname}:{port}/{service location} and https://{hostname}:{port}/{service location}Default port number:80 for http and 443 for https
ws2007HttpBinding Service Configuration
ws2007HttpBinding Client Configuration
<client> <endpoint address="http://localhost/Service1.svc" binding=" ws2007HttpBinding " contract="ServiceReference1.IService1"></endpoint> </client>
wsDualHttpBinding
The wsDualHttpBinding binding is similar to the wsHttpBinding binding, with additional support for duplex communication and lack of support for transport-level security. This type of communication called Advanced web service communication.
Address format: http://{hostname}:{port}/{service location}
Default port number:80 for http
wsDualHttpBinding Service Configuration
<services> <service name="EssentialWCF.Service1" behaviorConfiguration="EssentialWCF.Service1Behavior"> <host> <baseAddresses> <add baseAddress="http://localhost/EssentialWCF"/> </baseAddresses> </host> <endpoint address="" binding="wsDualHttpBinding" contract="EssentialWCF.IService1"></endpoint> </service> </services>
wsDualHttpBinding Client Configuration
<client> <endpoint address="http://localhost/Service1.svc" binding="wsDualHttpBinding" contract="ServiceReference1.IService1"></endpoint> </client>
Now I think we can decide with WCF binding type we can use in our solutions.
I hope this help.
No comments yet.
Leave a comment
-
Archives
- November 2009 (1)
- October 2009 (3)
- September 2009 (2)
- August 2009 (1)
- July 2009 (7)
- June 2009 (10)
- May 2009 (6)
- April 2009 (6)
- March 2009 (5)
- February 2009 (10)
- January 2009 (2)
-
Categories
-
RSS
Entries RSS
Comments RSS