System-Provided Bindings
Bindings specify the communication mechanism to use when talking to an endpoint and indicate how to connect to an endpoint. A binding contains the following elements:
The protocol stack determines the security, reliability, and context flow settings to use for messages that are sent to the endpoint.
The transport determines the underlying transport protocol to use when sending messages to the endpoint, for example, TCP or HTTP.
The encoding determines 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 criteria for your application, you can create a custom binding. For more information about creating custom bindings, see Custom Bindings.
A secure and interoperable binding that supports the WS-Federation protocol enables organizations that are in a federation to efficiently authenticate and authorize users.
Note: |
---|
Always select a binding that includes security. By default, all bindings except the <basicHttpBinding> element have security enabled. If you do not select a secure binding or disable security, be sure to protect your data in some other manner, such as storing in a secured data center or on an isolated network. |
Note: |
---|
Never use duplex contracts with bindings that do not support security or that have security disabled unless you secure the data by some other means. |
System-Provided Bindings
The following bindings ship with WCF.
Binding | Configuration Element | Description |
---|---|---|
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 is suitable for non-duplex service contracts. |
||
A secure and interoperable binding that is suitable for duplex service contracts or communication through SOAP intermediaries. |
||
A secure and interoperable binding that supports the WS-Federation protocol that enables organizations that are in a federation to efficiently authenticate and authorize users. |
||
A secure and optimized binding suitable for cross-machine communication between WCF applications. |
||
A secure, reliable, optimized binding that is suitable for on-machine communication between WCF applications. |
||
A queued binding that is suitable for cross-machine communication between WCF applications. |
||
A binding that enables secure, multiple machine communication. |
||
A binding that is suitable for cross-machine communication between a WCF application and existing Message Queuing applications. |
||
A binding that is suitable for communicating with WS-Basic Profile conformant Web services that enables HTTP cookies to be used to exchange context. |
||
A secure and optimized binding suitable for cross-machine communication between WCF applications that enables SOAP headers to be used to exchange context. |
||
A binding used to configure endpoints for WCF Web services that are exposed through HTTP requests instead of SOAP messages. |
||
A secure and interoperable binding that is suitable for non-duplex service contracts that enables SOAP headers to be used to exchange context. |
The following table shows the features of each of the system-provided bindings. The bindings are found in the table columns; the features are listed in the rows and described in a second 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.
Binding | Interoperability | Security (Default) | Session (Default) | Transactions | Duplex | Encoding (Default) | Streaming (Default) |
---|---|---|---|---|---|---|---|
BasicHttpBinding |
Basic Profile 1.1 |
(None), Transport, Message, Mixed |
(None) |
(None) |
n/a |
Text, (MTOM) |
Yes (buffered) |
WSHttpBinding |
WS |
Transport, (Message), Mixed |
(None), Reliable Session, Security Session |
(None), Yes |
n/a |
(Text), MTOM |
No |
WSDualHttpBinding |
WS |
(Message), None |
(Reliable Session), Security Session |
(None), Yes |
Yes |
(Text), MTOM |
No |
WSFederationHttpBinding |
WS-Federation |
(Message), Mixed, None |
(None), Reliable Session, Security Session |
(None), Yes |
No |
(Text), MTOM |
No |
NetTcpBinding |
.NET |
(Transport), Message, None, Mixed |
(Transport), Reliable Session, Security Session |
(None), Yes |
Yes |
Binary |
Yes (buffered) |
NetNamedPipeBinding |
.NET |
(Transport), None |
None, (Transport) |
(None), Yes |
Yes |
Binary |
Yes (buffered) |
NetMsmqBinding |
.NET |
Message, (Transport), None |
(None), Transport |
None, (Yes) |
No |
Binary |
No |
NetPeerTcpBinding |
Peer |
(Transport) |
(None) |
(None) |
Yes |
No |
|
MsmqIntegrationBinding |
MSMQ |
(Transport) |
(None) |
None, (Yes) |
n/a |
n/a |
No |
BasicHttpContextBinding |
Basic Profile 1.1 |
(None), Transport, Message, Mixed |
(None) |
(None) |
n/a |
Text, (MTOM) |
Yes (buffered) |
NetTcpContextBinding |
.NET |
(Transport), Message, None, Mixed |
(Transport), Reliable Session, Security Session |
(None), Yes |
Yes |
Binary |
Yes (buffered) |
WSHttpContextBinding |
WS |
Transport, (Message), Mixed |
(None), Reliable Session, Security Session |
(None), Yes |
n/a |
Text, (MTOM) |
No |
The following table explains the features listed 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:
|
Session |
Specifies whether this binding supports session contracts. |
Transactions |
Specifies whether transactions are enabled. |
Duplex |
Specifies whether duplex contracts are supported. Note that this feature requires support for Sessions in the binding. |
Encoding |
Specifies the wire format of the message. Allowable values include:
|
Streaming |
Specifies whether streaming is supported for incoming and outgoing messages. Use the TransferMode property on the binding to set the value. The allowable values include:
|
See Also
Concepts
Endpoint Creation Overview
Using Bindings to Configure Services and Clients