Request for best approach ideas in regards to Event and Call backs in WCF RRS feed

  • Question

  • I am new to WCF so I am struggling to find the best solution for what I am doing.

    I have a windows service that starts both a static running class and a Web Service (NetTCPBinding).

    The static running class connects to multiple servers and gathers information from each server and then sends the data to various outputs(database tables most of the time).

    The Web Service starts and stops these connections and can configure them if needed.  I have all this working so far.

    What I am looking for is I want to implement 2 features in my Web Service.  One I want to be able to update clients when a server connection has be stopped/started or has an error.  I was thinking this fits a subscribe/publish scenario.  Except, would my static class have to implement the Client for the web service in order to publish updates? All the samples are laid out this way.  Since my web service has an instance of the class can it just check for updates and post them itself or use a delegate?

    I also want to be able to "connect" and watch the data that is being gathered from that server.  To me this sounds more like a callback or am I way off there?  I basically need a real-time feed via the web service for watching what the class is reading.  I have calls for my static class that returns the data, I just need to have a timer to read this and send it back to the clients of the web service.  Does publish/subscribe fit this as well or is that not designed for this?

    Can I host both a subscribe/publish and callback in the same service?  Is there a better way to do this?

    Thanks for your time.

    Sunday, August 5, 2012 2:57 PM