• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JAX-WS: Always return String as CDATA.

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,

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?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic