I have a SS WS which creates XML files. Sometimes the incoming strings include non-printable characters like 0x1F which are invalid for XML. I could validate each string before serializing to XML, but I wonder if it would be easier to add a filter to SS which replaces all 0x1F chars with a blank space in all fields of type string.
If so, Is there sample code showing how to add a filter like this to SS?
If you want to do this for all XML Content Types than probably the easiest solution is to take over the XML Content Type and add any pre-processing you need before sending it to the XmlSerializer, e.g: