Duplex communication using NetTcpBinding - ContractFilter mismatch?

前端 未结 2 1416
情话喂你
情话喂你 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条回答
  •  萌比男神i
    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! :)

提交回复
热议问题