MSDN article
A duplex contract allows clients and servers to communicate with each other independently.

The example below designs an imaginary service where a client notifies the server that it has data to be processed. When the server can process this data, it notifies the client and then the client sends the actual data to the server.

[ServiceContract( Namespace="http://www.3dOffice.ro/Service/",
SessionMode=SessionMode.Required,
CallbackContract=typeof(IRequestData)]
public interface INotifyDataAvailable
{
[OperationContract( IsOneWay=true)]
void DataAvailable();
}

public interface IRequestData
{
[OperationContract( IsOneWay = true ) ]
void CanRead();
}

public interface IProcessData
{
[OperationContract]
void Process( IData data );
}
// This IProcessData is the interface
// the client will use to actually send
// the data processing request to the server.

A SkyDrive working sample

Advertisements