WCF: How to create a one-way contract

Create the service contract by applying the ServiceContractAttribute class to the interface that defines the methods the service is to implement.

Indicate which methods in the interface a client can invoked by applying the OperationContractAttribute class to them.

Designate operations that must have no output (no return value and no out or ref parameters) as one-way by setting the IsOneWay property to true. Note that the operations that carry the OperationContractAttribute class satisfy a request-reply contract by default because the IsOneWay property is false by default. So you must explicitly specify the value of the attribute property to be true if you want a one-way contract for the method.

No comments:

Post a Comment