Hi guys , i am using JSON to send data to server and fetching response back and using it .
Now what i want to do ideally is create an object of a class whose members name is key and member value is value for a JSON object
Example
class MyClass
{
string code;
string message;
public abc()
{
code = null;
message = null;
}
}
func()
{
MyClass myClassObj = new MyClass();
myClassObj.a = "hello";
myClassObj.a = "hey";
JSONObject jObj = new JSONObject();
Some way to put the myClassObj in JSONObject and send it to server.
Now server gives response as say
{"error":{"null"},"result":{"message":"success","code":200,"data":"13123131"},"id":"ada"}
On retreival i should be able to assign JSONObject to MyClass object and all values such as code , message should be automatically retrievable
}
I have seen some dot net examples whering serialization /deserialization has been done to objects . How can i do it here?


