Duplex communication using NetTcpBinding - ContractFilter mismatch?

我们两清 提交于 2019-12-01 00:31:58

Kudos to @Allon Guralnek, who helped me notice what was wrong:

On the server side I had:

[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)]
class WebService : IWebService { ... }

And on the client side I had:

[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession, Namespace="http://MyWebService")]
class SiteServer : IWebServiceCallback { ... }

The conflict was between PerCall and PerSession. I just changed the server side to PerSession, and - Houston, we have lift-off!

Now, to get this working with security... watch SO for the next exciting installment in my WCF learning curve! :)

You listed your callback contract as ISiteServiceExternal but your client implements IWebServiceCallback. Fix that first and see if you have success.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!