Reputation: 17775
I want to be able to Ajax-ly retrieve JSON data from some kind of web service. (The web service calls will be wrapping a call to SQL, processing the DataSet returned, and returning a JSON representation.) Initially, I thought an ASP.NET MVC project with appropriately named Controllers and Actions that return JsonResults would suffice. However, a colleague suggested WCF might be a better fit for something like this. It's been my experience that WCF is difficult to configure; moreover, the way MVC exposes Actions through Controllers seems very elegant.
Which is a better fit for what I'm trying to do, MVC or WCF?
Upvotes: 6
Views: 800
Reputation: 245429
If you're going to create services that create strictly JSON (with no other end-points on the horizon), I find that .NET MVC is much easier to use and produces better results.
If you think you might want multiple types of end-points (SOAP, etc.) at some point in the future, then go with WCF.
Keep in mind that there are rumblings from the WCF team that they are about to release something that will completely overhaul how RESTful JSON services in WCF are done. It should be interesting.
Upvotes: 7