0 Replies Latest reply: May 30, 2012 3:20 PM by 361137 RSS

    How do I achieve this desired structure w/ annotations?

      I want my resulting xml out of JAX-WS to look like this:

      <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
      <ns2:getTestResponse xmlns:ns2="http://webservice.test/">
      <child id="1"/>
      </ns2:getTestResponse >

      but I cant seem to get that output with the way I annotate my objects.

      I am trying to do it with 2 classes, a class called TopLayer and a Child class which are definted like this:

      @XmlRootElement(name = "top-layer")
      public class TopLayer {

      List<Child> children;

      public class Child{

      int id;

      of course omitted the getters/setters (Actually my annotations are on the getters but doing it this way for readability)

      But the resulting xml out of the jax-ws response looks odd, it totally omits the top-layer tag, and just puts:

      <children id="1000"/>

      Do I have to throw in 2 more classes just to get the structure I want?

      Edited by: trant on May 30, 2012 1:20 PM