Implementing observer pattern using WCF

后端 未结 6 998
眼角桃花
眼角桃花 2021-02-04 22:20

When I first posted this question I had strong coupling between my web service and application controller where the controller needed to open multiple threads to the service and

6条回答
  •  花落未央
    2021-02-04 22:46

    OK the solution to my problem came from WCF

    In addition to classic request-reply operation of ASMX web services, WCF supports additional operation types like; one-way calls, duplex callbacks and streaming.

    Not too hard to guess, duplex callback was what I was looking for.

    Duplex callbacks simply allow the service to do call backs to the client. A callback contract is defined on the server and client is required to provide the callback endpoint on every call. Then it is up to the service to decide when and how many times to use the callback reference.

    Only bidirectiona-capable bindings support callback operations. WCF offers the WSDualHttpBinding to support callbacks over HTTP (Callback support also exists by NetNamedPipeBinding and NetTcpBinding as TCP and IPC protocols support duplex communication)

    One very important thing to note here is that duplex callbacks are nonstandard and pure Microsoft feature. This is not creating a problem on my current task at hand as both my web service and application are running on Microsoft ASP.NET

    Programming WCF Services gave me a good jump start on WCF. Being over 700 pages it delves deep into all WCF consepts and has a dedicated chapter on the Callback and other type of operations.

    Some other good resources I found on the net are;

    Windows Communication Foundation (WCF) Screencasts

    MSDN Webcast: Windows Communication Foundation Top to Bottom

    Web Service Software Factory

    The Service Factory for WCF

提交回复
热议问题