You might get the following message when trying to serialize a JSON response from a REST service with DataContractJsonSerializer :
End element 'XXX' from namespace 'XXX' is expected. Found element 'XXX' from namespace 'XXX'
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 nested properties when the destination property in your data contract could declare simple class String.