You are creating a Windows Communication Foundation (WCF) service. You have the following requirements:
* Messages must be sent over TCP
* The service must support transactions.
* Messages must be encoded using a binary encoding
* Messages must be secured using Windows stream-based security.
You need to implement a custom binding for the service. In which order should the binding stack be configured?
A.
tcpTransport, windowsStreamSecurity, transactionFlow, binaryMessageEncoding
B.
transactionFlow, binaryMessageEncoding, windowsStreamSecurity, tcpTransport
C.
windowsStreamSecurity, tcpTransport, binaryMessageEncoding, transactionFlow
D.
binaryMessageEncoding, transactionFlow, tcpTransport, windowsStreamSecurity
Explanation:
From higher to lower stack levelYou can add binding elements by adding the desired BindingElement objects to its Elements collection.
The order in which the binding element is added is very important. The order of adding the binding elements is as follows:
1. Transaction Flow (not required)
2. Reliable Messaging (not required)
3. Message Security (not required)
4. Composite Duplex (not required)
5. Message Encoding (required)
6. Transport Security (not required)
7. Transport (required)Bindings
(http://msdn.microsoft.com/en-us/library/ff650874.aspx)WCF Bindings in Depth
(http://msdn.microsoft.com/en-us/magazine/cc163394.aspx)
At the following links, Microsoft’s website conflicts with itself by stating that WindowsStreamSecurity must be defined before
BinaryMessageEncoding.
See:
http://msdn.microsoft.com/en-us/library/ms731377%28v=vs.100%29.aspx
http://msdn.microsoft.com/en-us/library/system.servicemodel.channels.custombinding%28v=vs.100%29.aspx
http://msdn.microsoft.com/en-us/library/aa347793%28v=vs.100%29.aspx