JSON (2)

Issues with serializing JSON response from REST

You might get the following message when trying to serialize a JSON response from a REST service with DataContractJsonSerializer :

If your message looks similar to this example you should check your data contract classes. It’s possible that some property has an invalid type association. For example, the REST service could return complex type Person with […]

Post JSON objects with nested classes to MVC action

Default view model binding of ASP.NET MVC has a disadvantage when using view models with nested classes and JSON objects. The binding is unable to recognize such nested classes and it initializes them to NULL value. This text describes a cause and solutions.