Hello,

I am using Axis2 1.2 and my ws endpoint is a pojo class. The return type is a java bean. No matter in what order I define the properties in the java bean, Axis always sorts the property names in alphabetical order and render them in that order in xml. Eg. my bean is defined as:

   public class balance{
       private String id;
       private String name;
       private int balance;
       ...//getters& setters
   }

The xml schema that axis generates would be like(in alphabetical order of the property names):

- <#> <xs:complexType name="Balance">
- <#> <xs:sequence>
<xs:element name="balance" nillable="true" type="xs:int" /> //becomes first because of alphabetic order
 <xs:element name="id" nillable="true" type="xs:string" />
 <xs:element name="name" type="xs:string" />
  </xs:sequence>

And if I query the service thru REST, the response xml would be like:

...
<balance.../>
<id.../>
<name.../>

Is there a way that I can change the behavior of the formatter and the sequence of the properties?

Thanks!

Reply via email to