What is the best way to implement a callback scenario using WCF and ASP.NET MVC?
- by Mark Struzinski
I am new to WCF. I just finished reading Learning WCF and I think I've got a pretty good grasp of the fundamentals. I am adding functionality to a line of business app that runs on ASP.NET MVC entirely inside the corporate LAN. I am calling into a service that will also send me events as they occur (and not as responses to service calls). These events can occur at any point during the user's session. I have the service written, and it is able to pick up these events.
What would be the best way to deliver these events to the user? My initial thought is to run the WCF service in duplex mode over net TCP and implement the events as callbacks. Using this scenario, the best way I can think up to deliver the events to the user is a dictionary object stored in the session. The dictionary would be populated by the callbacks and polled on a set frequency for delivery via AJAX calls.
Has anyone dealt with this scenario? Is there a more efficient way to implement this?