Oliver Dalley
Oliver Dalley

Reputation: 101

manipulate marshaller in jax-ws

is there a way to manipulate the marshaller used in jaxws. I like to send a cdata filed in a webservice request and for this i want to try something like describet here: http://odedpeer.blogspot.de/2010/07/jaxb-sun-and-how-to-marshal-cdata.html

in short they does this:

Marshaller m = JAXBContext.newInstance( Item.class ).createMarshaller();  
m.setProperty( "com.sun.xml.internal.bind.characterEscapeHandler", new CharacterEscapeHandler() {  
  @Override  
  public void escape( char[] ac, int i, int j, boolean flag, Writer writer ) throws IOException  
  {  
   // do not escape  
   writer.write( ac, i, j );  
  }  
});  

is this possible with jaxws somehow?

Upvotes: 4

Views: 1522

Answers (1)

Paulius Matulionis
Paulius Matulionis

Reputation: 23413

Well, the answer to your question is:

JAX-WS is based on JAXB so yes, it is possible, just create JAXB related stuff (as you showed in your question) in your application and you'll be able to process XML from your request in your web service.

Upvotes: 1

Related Questions