I hava rpc encoded style web service that returns a string as response. In the string I'll storing a xml file which has CDATA sections and some inline DTD. My problem is sometimes I am getting an error from axis serialization classes saying that there is an invalid character in xml.
So is it better to convert the xml data into a BASE64 string (may be using AXIS API Or Jakarta Commons API) and return that string as response ? or is there any other way of returning xml files as strings ?
In essence, consider escaping (encoding) the offending characters in the text and stop using CDATA sections altogether. This of course means that you will have to decode the content on the other end.
Joined: Sep 17, 2001
That is a nice explanation. I dont have any CDATA sections in my XML. I am wondering are there any best practices of sending xml file in SOAP messages?
Joined: Aug 19, 2005
Originally posted by RR Kumaran: I dont have any CDATA sections in my XML.
Originally posted by RR Kumaran: a xml file which has CDATA sections and some inline DTD
Data Type Definition language isn't XML. So by definition a well-formed XML document (SOAP envelope) cannot contain an inline DTD unless the inline DTD is encoded/escaped (this is why XML schema was created).
Originally posted by RR Kumaran: I am wondering are there any best practices of sending xml file in SOAP messages?