Serializing response from JSP and converting them to C# objects

Posted by SARAVAN on Stack Overflow See other posts from Stack Overflow or by SARAVAN
Published on 2011-02-02T07:10:42Z Indexed on 2011/02/02 7:25 UTC
Read the original article Hit count: 309

Filed under:
|
|

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

© Stack Overflow or respective owner

Related posts about c#

Related posts about jsp