0

I have a webservice which is written in mvc. In controller, I return json object without any view page. Like;

return Json(model, JsonRequestBehavior.AllowGet);

It just print the json object to the browser. now, i need to reach that json object from another mvc project.

I may try to get the source code of that page and parse it to json. Is that way sufficient?

or Is there any other efficient way to reach and parse that json object?

abby
  • 680
  • 2
  • 10
  • 22
  • Are you calling this web service through an AJAX call, or as a web service in the C# code? – Scottie Feb 24 '14 at 19:04
  • what is the difference? now i am trying to reach it from c# code but maybe in the future i need to use it through an ajax. – abby Feb 24 '14 at 19:09
  • Well, a web service typically uses SOAP as the transport protocol while AJAX typically uses Json. I'm not sure if there is a way to tell your C# code that the web service is using Json instead of SOAP, but if you can, .Net should handle the parsing of the data for you. – Scottie Feb 24 '14 at 19:14
  • FYI, see this post: http://stackoverflow.com/questions/8205081/web-service-should-return-json – Scottie Feb 24 '14 at 19:17

0 Answers0