views:

228

answers:

1

see also Why do I get InvalidCastException from OperationContext.Current.GetCallbackChannel<>()

I wish to pass my own interface to OperationContext.Current.GetCallbackChannel, as I wish to make Asynchronous calls to the client(s) and hence need to add the “BeginMethod()” etc to the interface.

I can anexception saying it can’t cast to the interface if I pass any interface apart from the one that is named in the ServiceContract for the server I am implementing.

E.g. I have

<ServiceContract(CallbackContract:=GetType(IClient))>

On the server contract

And a interface defined as a subclass of IClient that adds the “BeginMethod()” etc, but I can’t ask for that interface from:

 OperationContext.Current.GetCallbackChannel<IClientWithAsycMethods>()