Duplex communication using NetTcpBinding - ContractFilter mismatch?

前端 未结 2 1400
情话喂你
情话喂你 2021-01-07 00:30

I\'m making slow and steady progress towards having a duplex communication channel open between a client and a server, using NetTcpBinding. (FYI, you can observe my newbie

相关标签:
2条回答
  • 2021-01-07 01:15

    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! :)

    0 讨论(0)
  • 2021-01-07 01:19

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

    0 讨论(0)
提交回复
热议问题