WCF Tutorial
Lección 97 de 236 · Part 32 Message Exchange Patterns in WCF · Bases de datos
Part 32 Message Exchange Patterns in WCF
Link for code samples used in the demo
http://csharp-video-tutorials.blogspot.com/2014/02/part-32-message-exchange-patterns-in-wcf_17.html
Link for all dot net and sql server video tutorial playlists
http://www.youtube.com/user/kudvenkat/playlists
In this video we will discuss, the different Message Exchange Patterns that are available in WCF.
Message Exchange Pattern describes how the client and the wcf service exchange messages. WCF supports the following 3 Message Exchange Patterns. The default Message Exchange Pattern in WCF is Request-Reply.
1. Request-Reply (Default)
2. One-Way
3. Duplex
Request-Reply:
1. This is the default Message Exchange Pattern
2. Client sends a message to a WCF Service and then waits for a reply. During this time the client client stops processing until a response is received from the wcf service.
3. The client waits for the service call to complete even if the operation return type is void.
4. All WCF bindings except the MSMQ-based bindings support the Request-Reply Message Exchange Pattern.
5. IsOneWay parameter of OperationContract attribute specifies the Message Exchange Pattern. The default value for IsOneWay parameter is false. This means that, if we don’t specify this parameter, then the Message Exchange Pattern is Request/Reply. So the following 2 declarations are equivalent.
[ServiceContract]
public interface ISampleService
{
[OperationContract(IsOneWay=false)]
string RequestReplyOperation();
[OperationContract(IsOneWay = false)]
string RequestReplyOperation_ThrowsException();
}
OR
[ServiceContract]
public interface ISampleService
{
[OperationContract]
string RequestReplyOperation();
[OperationContract]
string RequestReplyOperation_ThrowsException();
}
6. In a Request-Reply message exchange pattern faults and exceptions get reported to the client immediately if any.
Next Video: OneWay message exchange pattern