I have an xml webservice that I am returning an object which is built based on attributes from a database table. In one of the columns, companyname there is an invalid character. When I invoke the service, I get the error below as the xml is being parsed.
xmlParseCharRef: invalid xmlChar value 25
Is there any way that I can handle a character such as this without, for example doing regex on each element of my class? The service returns from 1 to several hundred records so I would not want to compromise the speed of the service based on that. I tried using encoding="UTF-8" in my xml header in the web.config but this does not help. Any suggestions?
The record that it is unable to handle contains the character below.
S