unable to return nested type to client from wcf json enabled service
I am unable to return nested type from wcf json service. When I do http get from RestClient (firefox) the service operation is executed twice and the response body is empty. calling the same service from url in chrome returns No data received. Error 324 ERR_EMPTY_RESPONSE
here's the code
[WebInvoke(Method=”GET”, ResponseFormat=WebMessageFormat.Json, RequestFormat= WebMessageFormat.Json, UriTemplate=”GetProducts/storedId”] public ServiceResponse>> GetAllProducts(string storeId) { // code to get list of products from the db. }
[DataContract] public class Product { [DataMember] public string Name {get; set;}
[DataMember] public IList ProductDetails {get; set;} }
Could someone please suggest what's going wrong. Thanks
我让WCF使用Json.NET(http://json.codeplex.com/)在.NET对象和JSON之间进行转换
链接地址: http://www.djcxy.com/p/45810.html