in Education by

What is Duplex in WCF? Explain also Message Exchange Pattern?

1 Answer

0 votes
by

Duplex

Duplex is a Two-Way Communication Process. In which, a consumer send a message to the service and the service sends a notification that the request processing has been done. It is just like that we send some command about the printing of some papers to the Printer machine. The printer machine start communication by making the connection with our machine, and start printing the paper.

  1. Duplex service allows calling back some operation (function) on the client.
  2. Duplex service also knows as Call Backs.
  3. All Binding does not support duplex service.
  4. Duplex communication is not standard. They are absolute Microsoft feature.
  5. wsDualHttpBinding supports duplex communication over HTTP binding.
  6. Duplex communication is possible over netTcpBinding and netNamedPipeBinding
  1. [ServiceContract(CallbackContract = typeof (DuplexServiceCallback))]  
  2. public interface IMyService  
  3. {  
  4.     [OperationContract(IsOneWay = true)] //one-way message   
  5.     void AddName(string name);  
  6.     [OperationContract] //request-response message   
  7.     string GetName(string name);  
  8. }  

Message Exchange Patterns in WCF:

The Message Exchange Pattern (MEP) provides a way of communication between client and server. MEP is a beauty of WCF. A services do some task depend on us or send a response to our request. The communication between client and server are done in form of messages. When we send a message as request and get a message as response from the service. The WCF Services support three types of Message Exchange Pattern:

  • Request-Response
  • One-Way
  • Duplex

Why we need the Message Exchange Pattern:

  1. When we want the calling of the function to not take more time.
  2. We just want to call the function and not want wait for the response.
  3. When we want that function call is not blocking and at the same time we want something out of the function (response) for our application.
  4. When we want a two-way communication mechanism.

Related questions

0 votes
    What Message Exchange Patterns (MEPs) supported by WCF? Explain each of them briefly....
asked Apr 3, 2021 in Education by JackTerrance
0 votes
    What is Message Contract in WCF?...
asked Apr 2, 2021 in Education by JackTerrance
0 votes
    Explain bindings in WCF with description?...
asked Apr 3, 2021 in Education by JackTerrance
0 votes
    Explain briefly different Instance Modes in WCF?...
asked Apr 3, 2021 in Education by JackTerrance
0 votes
    Explain transactions in WCF?...
asked Apr 2, 2021 in Education by JackTerrance
0 votes
    What is Information cards in WCF?...
asked Apr 3, 2021 in Education by JackTerrance
0 votes
    What is Instance Management in WCF?...
asked Apr 3, 2021 in Education by JackTerrance
0 votes
    What you understand by Fault Exception in WCF?...
asked Apr 3, 2021 in Education by JackTerrance
0 votes
    What is WCF Messaging Layer?...
asked Apr 3, 2021 in Education by JackTerrance
0 votes
    What is Method overloading in WCF?...
asked Apr 3, 2021 in Education by JackTerrance
0 votes
    What is MSMQ in WCF?...
asked Apr 3, 2021 in Education by JackTerrance
0 votes
    What is Transport level security in WCF?...
asked Apr 3, 2021 in Education by JackTerrance
0 votes
    What is SOA, and Messages in WCF?...
asked Apr 3, 2021 in Education by JackTerrance
0 votes
    What is Streaming in WCF?...
asked Apr 3, 2021 in Education by JackTerrance
0 votes
    What is Security Implementation in WCF? How many are there?...
asked Apr 3, 2021 in Education by JackTerrance
...