axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Deepal Jayasinghe <dee...@opensource.lk>
Subject Re: JavaBean Properties Order Sequence
Date Fri, 01 Jun 2007 04:58:39 GMT
Hi Chen ,

There is no way to change that , and if you are going to do so you will
have issues as well. According to my experience Annogen behave 
differently in different JVM and JDK , to overcome that I had to short
the bean property order. In the meantime we generate the correct XML
schema as well  
> 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!
>

-- 
Thanks,
Deepal
................................................................
"The highest tower is built one brick at a time"



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Mime
View raw message