There are various binding supported by WCF -
Scenarios to choose Binding
Old Client Support
- basicHttpBinding : Its designed to replace old ASMX web service. Supports Http and Https. Its specifically usefull to support SOAP 1.1. It doesn't support WS-* specifications like WS-Addressing, WS-Security, WS-ReliableMessaging
Featured Internet Communication - wsHttpBinding : This binding supports WS specifications, so its provide more security and reliable messaging. By default SOAP messages are encrypted. Support sessions. Supports Http and Https.
- wsDualHttpBinding : Its same like WSHttpBinding with support of duplex communication. It supports MEP (Message Exchange Pattern). Service as well can communicate to client via callback.
- wsFedratedHttpBinding : Its specialized form of WS binding with fedrated security.
- webHttpBinding : This binding is used to make Restful wcf service.
Single Computer - netNamedPipeBinding : It is usable when service resides in single computer only.
Same Business Network (Intranet) - netTcpBinding : It can be considered as enhancement over .Net Remoting. Uses Tcp binding. It provide security and reliable message transfering. Supports sessions. It provide best performance because both the ends have same .net technology. It uses Binary encoding of messages for transport.
- netPeerTcpBinding : Its same like NetTcp with peer to peer communication scenario.
Disconnected Communication - netMSMQBinding : When you required that your service can work in disconnected scenario (Without establishing communication channel).
It creates queue for messages and pick messages to process from queue. It provide secure message queuing.
WCF bindings
|
||||||
Binding
|
Protocol/
Transport
|
Message Encoding
|
Security
|
Default Session
|
Transaction
|
Duplex
|
BasicHttpBinding
|
Http, Https
|
Text
|
None
|
No
|
-
|
-
|
WSHttpBinding
|
Http, Https
|
Text
|
Message
|
Optional
|
Yes
|
-
|
WSDualHttpBinding
|
Http, Https
|
Text
|
Message
|
Yes
|
Yes
|
Yes
|
NetTcpBinding
|
TCP
|
Binary
|
Transport
|
Optional
|
Yes
|
Yes
|
NetNamedPipeBinding
|
Named Pipe
|
Binary
|
Transport
|
Yes
|
Yes
|
Yes
|
NetMsmqBinding
|
MSMQ
|
Binary
|
Transport
|
Yes
|
Yes
|
No
|
WSFederationHttpBinding
|
Http, Https
|
Text
|
Message
|
Yes
|
Yes
|
No
|
NetPeerTcpBinding
|
P2P
|
Binary
|
Transport
|
-
|
-
|
Yes
|
Scenarios to choose Binding
- If service to be consumed by clients compatible with SOAP 1.1, use basicHttpBinding for interoperability
- If service to be consumed within the corporate network, use netTCPBinding for performance
- If service to be consumed over the internet and the client is a WCF compatible, use wsHttpBinding to reap full benefits of WS* specifications
- If service to be accessible only in the same machine, use netNamedPipeBinding
- If service to be queue messages, use netMsmqBinding
- If service to act as server as well as client in a peer to peer environment, utilise netPeerTcpBinding setting
No comments:
Post a Comment