Bindings specify the communication mechanism to use when talking to an endpoint and indicate how to connect to an endpoint. Bindings consist of elements that define how the Windows Communication Foundation (WCF) channels are layered up to provide the required communication features. A binding contains three types of elements:
Protocol channel binding elements, which determine the security, reliability, context flow settings, or user-defined protocols to use with messages that are sent to the endpoint.
Transport channel binding elements, which determine the underlying transport protocol to use when sending messages to the endpoint, for example, TCP or HTTP.
Message encoding binding elements, which determine the wire encoding to use for messages that are sent to the endpoint, for example, text/XML, binary, or Message Transmission Optimization Mechanism (MTOM).
This topic presents all of the system-provided Windows Communication Foundation (WCF) bindings. If none of these meets the exact requirements for your application, you can create a binding using the CustomBinding class. For more information about creating custom bindings, see Custom Bindings.
Important
Select a binding that has security enabled. By default, all bindings, except the BasicHttpBinding binding, have security enabled. If you do not select a secure binding, or if you disable security, be sure your network exchanges are protected in some other manner, such as being in a secured data center or on an isolated network.
Important
Do not use duplex contracts with bindings that do not support security, or that have security disabled, unless the network exchange is secured by some other means.
A binding that is suitable for communicating with WS-Basic Profile conformant Web services, for example, ASP.NET Web services (ASMX)-based services. This binding uses HTTP as the transport and text/XML as the default message encoding.
A secure and interoperable binding that provides support for the correct versions of the Security, ReliableSession, and TransactionFlow binding elements.
A secure and interoperable binding that supports the WS-Federation protocol, enabling organizations that are in a federation to efficiently authenticate and authorize users.
A binding that is suitable for cross-machine communication between a WCF application and existing Message Queuing (also known as MSMQ) applications.
Binding Features
The next table shows some of the key features each of the system-provided bindings provided. The bindings are listed in the first column and information regarding the features is described in the table. The following table provides a key for the binding abbreviations used. To select a binding, determine which column satisfies all of the row features you need.
The following table explains the features found in the previous table.
Feature
Description
Interoperability Type
Names the protocol or technology with which the binding ensures interoperation.
Security
Specifies how the channel is secured:
- None: The SOAP message is not secured and the client is not authenticated. - Transport: Security requirements are satisfied at the transport layer. - Message: Security requirements are satisfied at the message layer. - Mixed: This security mode is known as TransportWithMessageCredentials. It handles credentials at the message level, and integrity and confidentiality requirements are satisfied by the transport layer. - Both: Both message level and transport level security are used. This ability is unique to the NetMsmqBinding.
Session
Specifies whether this binding supports session contracts.
Transactions
Specifies whether transactions are enabled.
Duplex
Specifies whether duplex contracts are supported. Note this feature requires support for Sessions in the binding.
Streaming
Specifies whether the message streaming is supported.
Learn how all communication with a WCF service occurs through the service endpoints, which provide clients access to the functionality offered by the service.