Illegal XML characters in soapResponse

Illegal character “0x0” coming from SAP system in response to RFC call in a webservice.soapResponse is incomplete because of this illegal XML character and we need to remove illegal character to get well formed soapResponse.

In what way we can filter out the unicode/hex characters and what are undesired effects of this code change?

When you do the document to XML string conversion for the SOAP body do you set encode to true? That will convert “illegal” characters to character entities.

The other approach is to work with the SAP admins to eliminate the 0x0 character (if it isn’t meaningful).

Thanks reamon, encode is set to true in document to XML string conversion.