axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Bodfish" <>
Subject RE: returning XML as xsd:string
Date Wed, 09 Feb 2005 00:05:17 GMT


Embedding an XML document in a SOAP message (which is an XML document
itself) is nearly impossible to do in with any guarantee that it will work
for any arbitrary document - unless you transform the XML document into a
character encoding that won't contain any characters that are treated
specially by the XML parser at the receiving end.


See  <> for more
details. The author's conclusion: "Unfortunately, while it can be
prohibitively expensive (in terms of message size and memory use), Base64
strings have been the only approach that works and is portable." Note that
if you choose this approach your application (and those you exchange message
with) will have to convert the embedded XML document to and from Base64.





From: Bruce McHaffie [] 
Sent: Tuesday, February 08, 2005 4:36 PM
To: ''
Subject: returning XML as xsd:string


Hi, I have a Java web service that returns xsd:string data to the Axis C++
client. I have noticed that if the returned string contains angle brackets
(<>) then the client fails (with a heap corruption message -- I'm running in
debug). The SOAP message is returned correctly, and the start element is
found. The error seems to happen when the client tries to parse the message
for the content of the string.


Client fails at:  getElementAsString( AxisChar* pName, AxisChar* pNamespace)

File is: SoapDeSerializer.cpp

Line number is: 3049 in Axis C++ 1.4,

Call is: m_pNode = m_pParser->next (true);


Sample SOAP message that fails:


    <getEnvelopeRecipientReturn xsi:type="xsd:string"><Any string at


Sample SOAP message that works:


    <getEnvelopeRecipientReturn xsi:type="xsd:string">Any string at


I tried escaping the angle brackets with &lt; and &gt; but that didn't solve
the problem. Any ideas?






View raw message