A CDATA section is a purely syntactic construct and has no semantic
meaning, i.e. in an XML document "<![CDATA[x <= y]]>" is expected to
be completely equivalent to "x &lt;= y". If an application makes a
distinction between these two ways of serializing character data, then
that application should be considered as broken. That is why XML
databinding frameworks generally don't give you control over how
character data is serialized, which in general means that they don't
use CDATA sections at all. This applies to POJOs, ADB generated code
and JAXB/JAX-WS (and probably to XmlBeans and JiBX as well). It's also
not an Axis2 specific limitation, but applies to other SOAP stacks as
well.

The only way to produce a CDATA section is to manipulate the message
at the XML object model level (Axiom in this case), either by
composing the message directly (i.e. without XML databinding) or by
transforming the message after the databinding step.

Andreas

On Wed, May 18, 2011 at 14:21, Christopher Johnson <[email protected]> wrote:
> All -
>
> Using axis2 1.5.3 I've noticed that when using POJO service and setting a
> string to include something like the following:
>
> object.setString( "<![CDATA[BLAH]]> " ) but the <,>'s are escaped when
> returned from axis.  How can I set the string value of an object in axis to
> include CDATA text so it's not escaped.
>
> my results over the wire look like: <string>&lt;![CDATA[BLAH]]&gt;</string>
>
> Thanks in advance.
>
> ..Chris
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to