How it works?
In order to make this work we need a pair of interfaces,
- First interface will be your service contract which contains operation contracts which client can invoke.
- Second interface contain operations which will act as a call back method for server. In simple words, contain methods which can be invoked by server.
In the service contract attribute we specify the callback interface as follows.
public class ClientCallBack : IClientCallback
InstanceContext instanceContext = new InstanceContext(new ClientCallBack ());
// Create a client
MyServiceClient client = new MyServiceClient (instanceContext);
At Server side, how callback methods will be accessed?