ASP.NET MVC and WCF

Posted by Michael Stum on Stack Overflow See other posts from Stack Overflow or by Michael Stum
Published on 2008-10-19T22:53:37Z Indexed on 2010/04/01 3:23 UTC
Read the original article Hit count: 452

Filed under:
|
|

I'm working my way into MVC at the moment, but on my "To learn at some point" list, I also have WCF.

I just wonder if WCF is something that should/could be used in an MVC Application or not? The Background is that I want a Desktop Application (.NET 3.5, WPF) interact with my MVC Web Site, and I wonder what the best way to transfer data between the two is. Should I just use special Views/have the controllers return JSON or XML (using the ContentResult)?

And maybe even more important, for the other way round, could I just call special controllers? Not sure how Authorization would work in such a context. I can either use Windows Authentication or (if the Site is running forms authentication) have the user store his/her credentials in the application, but I would then essentially create a HTTP Client in my Application. So while MVC => Application seems really easy, Application => MVC does seem to be somewhat tricky and a possible use for WCF?

I'm not trying to brute-force WCF in this, but I just wonder if there is indeed a good use case for WCF in an MVC application.

© Stack Overflow or respective owner

Related posts about .NET

Related posts about wcf