Validating soap perilsofdating org
However, it would be better to be able to use a framework class to do it without rolling our own.
Fortunately, there is such a class in the framework.
The characters below 32, except for tab, carriage return, and new line, the UTF-8 BOM, and invalid surrogate pairs are not allowed by the XML standard. That doesn’t help the user figure out what’s going on.
Now, if you add the following code to your wsdl.exe-generated subclass of Soap Http Client Protocol, you’ll get an Argument Exception on the client when trying to write the invalid XML in the SOAP message.
The exception message will state that there is an invalid character.
The problem is that if you have a method on your web service that takes a String parameter, someone may call that method with a string that contains characters that are not allowed in XML.
That input may come from a command line switch or a text box in a GUI.