Wednesday, April 20, 2011

The ABC of WCF Service

A WCF service allows communication through an Endpoint.

ABC is an abbreviation of Address, Binding and Contract attributes of an Endpoint.

A - Where is the endpoint?
B- How to communicate with endpoint?
C - What functionalities do the endpoint provide?

The Binding is an attribute of an endpoint and it lets you configure transport protocol, encoding and security.

Types of Binding

 

basicHttpBinding
This type of binding exists in new .Net world only to support backward compatibility with ASMX based clients (WS-Basic Profile 1.1). Basic http binding sends SOAP 1.1 messages and is used when there is a requirement for the WCF services to communicate with non WCF based systems.

Note: All other bindings except basicHttpBinding support WS* specifications including security, reliable messaging and transaction support, where appropriate.

wsHttpBinding
This binding sends SOAP 1.2 messages and implements WS* specifications to support enterprise requirements of security, reliability, ordered delivery and transaction management.

netTcpBinding
This binding sends SOAP 1.2 messages, provides binary encoding and optimized communication between WCF services and WCF clients on Windows network. This binding is the fastest binding amongst all WCF binding options. Unlike http bindings, the TCP binding does not offer interoperability but is highly optimized for .Net 3.0 and above clients. Thus, in .Net version 3.0 and above, providing an endpoint with netTcpBinding is an easy option to development of distributed systems and can replace COM+ and .Net Remoting model.

Bingding Interoperability Security Session Transactions Duplex
BasicHttpBinding Basic Profile 1.1 (None), Transport, Message None, (None) None n/a
WSHttpBinding WS Transport, (Message), Mixed (None), Transport, Reliable Session (None), Yes n/a
WSDualHttpBinding WS (Message) (Reliable Session) (None), Yes Yes
WSFederationHttpBinding WS-Federation (Message) (None), Reliable Session (None), Yes No
NetTcpBinding .NET (Transport), Message Reliable Session, (Transport) (None), Yes Yes
NetNamedPipeBinding .NET (Transport) None, (Transport) (None), Yes Yes
NetMsmqBinding .NET Message, (Transport), Both (None) (None), Yes No
NetPeerTcpBinding Peer (Transport) (None) (None) Yes
MsmqIntegrationBinding MSMQ (Transport) (None) (None), Yes n/a

No comments: