You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Stephen G Diesner (Commented) (JIRA)" <ji...@apache.org> on 2012/01/18 12:51:39 UTC

[jira] [Commented] (AXIS2-5082) POJO service has incorrect element sequence in response when useOriginalwsdl set to true

    [ https://issues.apache.org/jira/browse/AXIS2-5082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13188417#comment-13188417 ] 

Stephen G Diesner commented on AXIS2-5082:
------------------------------------------

I subsequently discovered that the ordering of elements via a POJO service was undetermistic, the order depending on the JVM vendor (and possibly JVM version).  A bit of debugging found that the cause of this was the vendor's implementation of java.beans.Introspector from which it got an array of property descriptors.  It was the ordering of elements in this array which resulted in object element sequencing.

In Axis 1.5.1 I patched the kernel's implemenation of DefaultSchmaGenerator.java at line 547 to sort the array using Array.sort( ).  Interestlying, there already was a Comparator class defined in DefaultSchmaGenerator so I used that.  This resulted in the element ordering being alphabetical.  I have not fully tested this patch but early indications show that it is working without other issues.
                
> POJO service has incorrect element sequence in response when useOriginalwsdl set to true
> ----------------------------------------------------------------------------------------
>
>                 Key: AXIS2-5082
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5082
>             Project: Axis2
>          Issue Type: Bug
>         Environment: Windows XP, Websphere Application Server 6.1.
>            Reporter: Stephen G Diesner
>
> Axis2 1.6.0.
> Using POJO service with parameter useOriginalwsdl set to true.
> Original WSDL as incorporated in aar file is returned successfully.  Service call works but the sequence of elements as specified in WSDL is not followed.
> Example:
> WSDL gives:
>             <xs:complexType name="CardholderDetailsEdo">
>                 <xs:sequence>
>                     <xs:element maxOccurs="unbounded" minOccurs="0" name="cardholderAddresses" nillable="true" type="ax25:CardholderAddressEdo"/>
>                     <xs:element minOccurs="0" name="dateOfBirth" nillable="true" type="ax22:DateEdo"/>
>                     <xs:element minOccurs="0" name="forename" nillable="true" type="xs:string"/>
>                     <xs:element minOccurs="0" name="registeredName" nillable="true" type="xs:string"/>
>                     <xs:element minOccurs="0" name="surname" nillable="true" type="xs:string"/>
>                     <xs:element minOccurs="0" name="title" nillable="true" type="ax22:CodedValueEdo"/>
>                     <xs:element minOccurs="0" name="tradingName" nillable="true" type="xs:string"/>
>                 </xs:sequence>
>             </xs:complexType>
> 			
> 			
> Soap response:
>               <ns:cardholderDetails>
>                   <ns:surname>ENGINE</ns:surname>
>                   <ns:tradingName xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
>                   <ns:forename>IVOR THE</ns:forename>
>                   <ns:registeredName xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
>                   <ns:cardholderAddresses>
>                      <ns:country>
>                         <ns:code>GB</ns:code>
>                         <ns:localCode>0</ns:localCode>
>                         <ns:decode>UNITED KINGDOM</ns:decode>
>                      </ns:country>
>                      <ns:postcode>TN33 0RE</ns:postcode>
>                      <ns:type>
>                         <ns:code>U</ns:code>
>                         <ns:localCode>11</ns:localCode>
>                         <ns:decode>UK</ns:decode>
>                      </ns:type>
>                      <ns:residentialStatus>
>                         <ns:code/>
>                         <ns:localCode>6</ns:localCode>
>                         <ns:decode>UNKNOWN</ns:decode>
>                      </ns:residentialStatus>
>                      <ns:purpose>
>                         <ns:code>R</ns:code>
>                         <ns:localCode>1</ns:localCode>
>                         <ns:decode>RESIDENTIAL</ns:decode>
>                      </ns:purpose>
>                      <ns:lines>EXGVXD AITHMEIOX</ns:lines>
>                      <ns:lines>HITVXD VIRX</ns:lines>
>                      <ns:lines>OXKVXOWEHCX</ns:lines>
>                      <ns:lines>CIGGVX</ns:lines>
>                      <ns:lines>XIOG OIOOXZ</ns:lines>
>                   </ns:cardholderAddresses>
>                   <ns:title>
>                      <ns:code>MR</ns:code>
>                      <ns:localCode>1</ns:localCode>
>                      <ns:decode>MR</ns:decode>
>                   </ns:title>
>                   <ns:dateOfBirth>
>                      <ns:day>19</ns:day>
>                      <ns:year>1948</ns:year>
>                      <ns:month>10</ns:month>
>                   </ns:dateOfBirth>
>                </ns:cardholderDetails>
> 			   

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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