How to I use my own interface with OperationContext.Current.GetCallbackChannel?
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 na开发者_高级运维med 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>()
see Why do I get InvalidCastException from OperationContext.Current.GetCallbackChannel<>()
精彩评论