Has anyone got a RESTful WCF service (in .NET4) successfully using JSON.NET to do serialization/deserialization?
What’s the best approach?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Can you provide a few more details about what you’re trying to do with JSON.NET? I’m not exactly sure what scenarios you’re trying to deal with — but I’ll give you my general experience with JSON.NET and WCF RESTful services.
I’ve built a number of WCF RESTful services that are called, primarily, by my client app using jQuery’s AJAX functionality. Generally, I have not had to use JSON.NET as the JsonSerializer does a fine job of serializing my return values (single values or
List<T>collections) perfectly fine and can navigate through the object without issue.The times that I’ve had to use JSON.NET is when I’m sending a JSON object as part of my POST variables that I’ve serialized on the client using the JSON2.js library. JSON.NET has done a fine job of serializing and deserializing those values without issue, too.
I like JSON.NET — haven’t had any issues. Honestly, when I started out, I thought I would use it a lot, but have found that I only need it for edge cases. Generally I rely on the built-in JSON serialization and deserialization capabilities in WCF.
I hope this helps. Please let me know if you need more info or if there are specific scenarios you’re trying to handle, and I’ll update my answer accordingly. Thanks!