简体   繁体   中英

Asynchronous call to WCF service from MVC controller

I have a restful WCF service that I need to call asynchronously from within an MVC controller.

What would be the "lightest" way of going about this?

我会使用它的异步方法(例如BeginGetResponse发出HttpWebRequest

I guess you are aware of the AsyncController which you can use as the base class for your MVC controller (rather than plain old Controller). This will offer you a mechanism for calling methods asynchrously. See here for more details:

http://msdn.microsoft.com/en-us/library/ee728598.aspx

http://www.wintellect.com/CS/blogs/jprosise/archive/2010/03/29/asynchronous-controllers-in-asp-net-mvc-2.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM