Solved

JSON Deserialization

Posted on 2013-05-24
3
366 Views
Last Modified: 2013-05-24
I have a complex user defined class that contains strings, and int, but also contains other class types, and lists of classes. A simple example is below:

public class Data
{
      public Int32 Id { get; set; }
      public String Name { get; set; }
      public List<Items> Items { get; set; }
}

public class Item
{
      public Int32 Id { get; set; }
      public String Name { get; set; }
}

Open in new window




I have managed to serialize an instance of this class using SimpleJSON.

The problem I have is de-serializing it back to an instance of the original strongly typed class.  

I have spent hours search the web, but cannot find any simple definitive answer.
0
Comment
Question by:townsma
3 Comments
 
LVL 25

Accepted Solution

by:
Luis Pérez earned 500 total points
Comment Utility
Have you tried Json.Net? It's very easy to serialize/deserialize objects with this library, even if your objects contains complex properties.

http://james.newtonking.com/projects/json-net.aspx

Hope that helps.
0
 
LVL 6

Expert Comment

by:worm-getter
Comment Utility
0
 
LVL 6

Author Closing Comment

by:townsma
Comment Utility
Thanks, just what I was looking for.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now