开发者

How to I use my own interface with OperationContext.Current.GetCallbackChannel?

开发者 https://www.devze.com 2022-12-12 09:54 出处:网络
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 As

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<>()

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号