unable to return json data, WCF Resful Service .NET 4.0

谁说胖子不能爱 提交于 2019-12-06 13:41:11
D.J

By using Service Trace Viewer, actually there a number of ways of getting the problem. This link helped me. I finally see the problem, however being stacked gain with the problem.

'The type 'xxx.DataEntity.AppView' cannot be serialized to JSON because its IsReference setting is 'True'. The JSON format does not support references because there is no standardized format for representing references. To enable serialization, disable the IsReference setting on the type or an appropriate parent class of the type.'

I will start a new question for that.

Piotr Czyż

I had the same problem when I've not set one of the parameters of an object. For example I have a class:

public class Obj {
   int param1 { get; set; }
   int param2 { get; set; }
};

And if param1 or param2 was null or minValue (for DateTime), so I got the problem. When I set all parameters then the problem disappear.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!