Serializing response from JSP and converting them to C# objects
- by SARAVAN
I have a silverlight web application. From this app I am making a call to .jsp pages using WebClient class. Now jsp returns a response in the following format
{
"results":[{"Value":"1","Name":"Advertising"},
{"Value":"2","Name":"Automotive Expenses"},{"Value":"3","Name":"Business Miscellaneous"}]
}
The above response is assigned to my Stream object.
I have a c# class CategoryType
public class CategoryType
{
public string Value{get;set;}
public string Name{get;set;}
}
My aim is to convert the reponses in to Collection<CategoryType> and use it in my C# Code
As of now I am trying to use DataContractJSONSerialiser. But not sure if there is an easy and efficent way to do this. Any help would be appreciated