I have a REST service which takes JSON and XML as input and does a SOAP call to an extenal service with the deserialized content. The classes which are used for deserialization are auto-generated from the wsdl of the SOAP service. I use the XmlSerializer in case of a XML request and I want to use the Newton JSON.NET JsonSerializer for JSON.
Now I have the problem, that the WSDL generated classes contain the "Specified" property for optional atomar values (such as bool, int etc.). This is handled by the XmlSerializer (who sets the property accordingly to the reveived XML) but not by the Newton JSON.NET Serializer. I don't want to force the caller to add the XXXSpecified elements to the JSON string.
How can I treat the "Specified" properties with the JSON.NET serializer?