Reputation: 383
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
Upvotes: 1
Views: 640
Reputation: 383
I got WCF to use Json.NET (http://json.codeplex.com/) to convert between .NET objects and JSON
Upvotes: 0