Construction of a Custom Binding
A custom binding is constructed using the CustomBinding constructor from a collection of binding elements that are "stacked" in a specific order:
At the top is an optional TransactionFlowBindingElement class that allows flowing transactions.
Next is an optional ReliableSessionBindingElement class that provides a session and ordering mechanisms as defined in the WS-ReliableMessaging specification. A session can cross SOAP and transport intermediaries.
Next is an optional SecurityBindingElement class that provides security features such as authorization, authentication, protection, and confidentiality.
Next is an optional CompositeDuplexBindingElement class that provides the ability to have two way duplex communication with a transport protocol that does not support duplex communication natively, such as HTTP.
Next is an optional OneWayBindingElement) class that provides one-way communication.
Next is an optional stream security binding element which can be one of the following.
SslStreamSecurityBindingElement
WindowsStreamSecurityBindingElement
Next is a required message encoding binding element. You can use your own message encoder or one of the three message encoding bindings:
TextMessageEncodingBindingElement
BinaryMessageEncodingBindingElement
MtomMessageEncodingBindingElement
At the bottom is a required transport element. You can use your own transport or one of the following transport binding elements Windows Communication Foundation (WCF) provides:
TcpTransportBindingElement
HttpTransportBindingElement
HttpsTransportBindingElement
NamedPipeTransportBindingElement
PeerTransportBindingElement
MsmqTransportBindingElement
MsmqIntegrationBindingElement
ConnectionOrientedTransportBindingElement
The following table summarizes the options for each layer.
Layer Options Required
Transactions
TransactionFlowBindingElement
No
Reliability
ReliableSessionBindingElement
No
Security
SecurityBindingElement
No
Encoding
Text, binary, Message Transmission Optimization Mechanism (MTOM), custom
Yes
Transport
TCP, HTTP, HTTPS, named pipes (also known as IPC), Peer-to-Peer (P2P), Message Queuing (also known as MSMQ), Custom
Yes
In addition, you can define your own binding elements and insert them between any of the preceding defined layers.
No comments:
Post a Comment