WCF / ASP.NET MVC : Supporting events from WCF to asp.net MVC or similar concept?
I would like to simulate events from a WCF Service, is this at all possible? I have heard about DUPLEX WCF (2 way calling) but maybe there is a better way.
Here is what I need to do, from my ASP.NET MVC app, I need to initiate a call to the WCF Service, for this ca开发者_如何转开发ll to complete it can take a very long time hence it would timeout. I would like to pass the call to WCF and return back to the web page where I can inform the client that the process is running. I need to be able to receive events (or similar concept) on asp.net mvc to inform the client where it is at and how the progress is going.
WCF 2 WAY Duplex calling sounds good, otherwise maybe having jQuery call (on a timer) to get the process. Although I think this wouldn't work. I really need some kind of event driven model to work with WCF.
It may not be the best way but I did something similar using as you suggested a jQuery timer ticking away. I directed the user to a page with a loading message and then made an ajax call with a longer timeout set. I'm not sure how long yours is so this may not work.
http://api.jquery.com/jQuery.ajax/
timeout perameter
精彩评论