Binding will describes how client will communicate with service. There are
different protocols available for the WCF to communicate to the Client. You can
mention the protocol type based on your requirements.
Binding has several characteristics, including the following:
Binding has several characteristics, including the following:
- Transport
Defines the base protocol to be used like HTTP, Named Pipes, TCP, and MSMQ
are some type of protocols.
- Encoding (Optional)
Three types of encoding are available-Text, Binary, or Message Transmission
Optimization Mechanism (MTOM). MTOM is an interoperable message format that
allows the effective transmission of attachments or large messages (greater than
64K).
- Protocol(Optional) Defines information to be used in the binding such as Security, transaction or reliable messaging capability
Types Of Binding
ReplyDeleteBasicHttpBinding: If clients can be non-WCF. This exposes service to the outside world as if it was an ASMX (webservice). You cannot take advantages of modern WS* protocol on this binding. This is unsecure binding by default.
NetMsmqBinding: If client is WCF application and requires offline or disconnected interaction choose NetMsmqBinding which uses MSMQ for transporting the messages.
NetTcpBinding: If client requires connected communication and no problem on communicating between firewalls as it requires port to open for communication across firewalls. This is WCF to WCF communication.This is secure and optimized binding that is suitable for on machine communications between WCF applications.
NetNamedPipeBinding (IPC Binding): It is similar to TCP protocol but if requirement is to communicate on same machine then you can consider it.
WSHttpBinding: If you want a secure and interoperable binding that is suitable for non-duplex service contracts.
WSDualHttpBinding (WS dual binding): It is similar to WS binding but it can also support duplex communication from service to client.It it nothing more than two WsHttpBinding bindins wired up against each other to support callbacks