I'm using JAX-WS in order to implement a web service. The web service receives XML as parameter and returns XML. I use Java Strings for this (i.e. the XML data comes as string and gets returned as a string):
Now when I return small XML instances (with few < and >), the String is not wrapped within CDATA but instead the < are parsed into <. However if the instances that are returned are big enough, suddenly my web service packs everything into a CDATA passage.
The latter is actually what I want: I want every string to be represented as a CDATA field. But my service won't return the short XML instances as CDATA. Is there any way to force JAX-WS to always return the string within a CDATA passage?