asp.net mvc - mvc return Json() vs. JSON based Web Service -


I want to expose a service on my site that a user can make a call and get a JSON response . Lastly, I want users to use this service as much as possible.

My site was created using the ASP.NET MVC framework and I was wondering what is the best way to do this ...

I think most of People say that it is clear to use a web service (* .asmx) that gives the JSON format, but I know that I can only create a URL that the user can call and it is a JSON format Can return well (eg: calling "" JSON list Apas will come). Returns in ASPN.net using the Jason () method.

In this way, this is a web service versus advantages / disadvantages, which has been specifically done for it?

I do not know that most people use an .asmx web service. Personally I have been in a while. The command web service is not created and I must go for the MVC approach. Only those things should concern me:

  1. Changes in the future in data, URLs, and / or standards.
  2. To make the controller bigger or deplete, in that case you can create a separate API controller.

The advantage for me is that it is more consistent with the rest of your app, it's simple and easy to work on, and not much to configure.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -