Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Request-Response Vs Duplex WCF Message Exchange Pattern

What is the main difference between Request-Response and Duplex in WCF Message Exchange Pattern?

like image 300
Morteza Azizi Avatar asked Dec 02 '12 16:12

Morteza Azizi


People also ask

What is the main difference between request-response and duplex in WCF message exchange pattern?

In the request/reply and one-way message exchange patterns, only the client can initiate communication. In the duplex pattern, both the client and the service can initiate communication.

What are the message exchange patterns supported by WCF?

The three basic message exchange patterns. Top to bottom: datagram, request-response, and duplex. Each of these MEPs can also support sessions.

What is the default message exchange pattern in WCF?

The default message exchange pattern is request-reply in WCF. The client only sends the request to the service and it will not wait for the response back from the service. The client will not get any exceptions if it is occurring during the service processing it, because the client is not waiting for the result here.

Which of the message exchange pattern is not supported in WCF?

Even if some error occurs in communication, WCF Service doesn't send any response back. That's why One-Way Message Exchange Pattern provides no support for followings in service operations: no output parameters. no reference parameters.


1 Answers

The main difference is that, after the client establishes a channel to the service, the service can call the client independently at any time. In Request-Response the service only communicates back after receiving a Request from the client. So by using duplex you receive an event-like behavior from the client perspective. Obviously such enhancement requires a Session to be maintained (instance mode PerSession on the service). You can read more on the msdn.

like image 174
dmusial Avatar answered Sep 24 '22 05:09

dmusial