6

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?

1 Answer 1

7

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.

Sign up to request clarification or add additional context in comments.

2 Comments

"produces better results" can you clarify? Do you mean overall or the quality of the JSON?
@jfar - I was thinking about the size of the JSON results (poorly worded in the answer though). WCF includes type hinting which can add a lot of "unnecessary" overhead in the JSON response for large nested collections.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.