You need to create a duplex contract

You are developing a WCF service.
You need to create a duplex contract.
What should you do? (Each correct answer presents part of the solution. Choose all that apply.)

You are developing a WCF service.
You need to create a duplex contract.
What should you do? (Each correct answer presents part of the solution. Choose all that apply.)

A.
Apply the MessageContractAttribute attribute to every public method signature included in the appropriatecontract.

B.
Create an interface for the client-side duplex contract.

C.
Create an interface for the server-side duplex contract.

D.
Apply the MessageContractAttribute attribute to the appropriate interface.

E.
Apply the ServiceContractAttribute attribute to the appropriate interface. Then, apply the
OperationContractAttribute attribute to every public method signature included in that contract.

F.
Set the CallbackContract property to the appropriate interface.

Explanation:
To create a duplex contract
1. (C) Create the interface that makes up the server side of the duplex contract.
2. (E) Apply the ServiceContractAttribute class to the interface.
3. Declare the method signatures in the interface.
4. (E) Apply the OperationContractAttribute class to each method signature that must be part of the public
contract.
5. Create the callback interface that defines the set of operations that the service can invoke on the client.
6. Declare the method signatures in the callback interface.
7. Apply the OperationContractAttribute class to each method signature that must be part of the public contract.
8. (F) Link the two interfaces into a duplex contract by setting the CallbackContract property in the primary
interface to the type of the callback interface.
How to: Create a Duplex Contract



Leave a Reply 1

Your email address will not be published. Required fields are marked *