For me it was a circular link issue.
The accepted answer did not work for me, because it changes the JSON formatting behavior, but I received XML when I called the service from the browser.
To fix this, I turned off XML and forcibly returned only JSON.
In the Global.asax file, place the following lines at the top of your Application_Start method:
GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; GlobalConfiguration.Configuration.Formatters.Remove(GlobalConfiguration.Configuration.Formatters.XmlFormatter);
Now only JSON results will be returned. If you need XML results, you will need to find another solution.
Zane Nov 27 '13 at 20:02 2013-11-27 20:02
source share