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 (Issue Comment Edited) (JIRA)" <ji...@apache.org> on 2012/01/19 10:17:39 UTC

[jira] [Issue Comment Edited] (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=13189020#comment-13189020 ] 

Stephen G Diesner edited comment on AXIS2-5082 at 1/19/12 9:17 AM:
-------------------------------------------------------------------

Uploaded kernel module's DefaultSchemaGenerator from the Axis 1.5.1. source code as requested.  Change is at line 547 to add sorting of property descriptors.

Note that the Comparator class as used in the existing class seems a bit over complicated (unless I'm missing something). A simpler one would be

	/**
	 * Comparator class for {@link PropertyDescriptor} objects based on the property's name
	 * 
	 * Compares the two arguments for order based on the property's name. Returns a negative integer, 
	 * zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
	 */
	private class PropertyComparator implements Comparator{
		
		public int compare(Object arg0, Object arg1) {
			PropertyDescriptor a = (PropertyDescriptor)arg0;
			PropertyDescriptor b = (PropertyDescriptor)arg1;
			return a.getName().compareTo(b.getName());
		}
	}
                
      was (Author: steve.diesner):
    Axis 1.5.1. source code.  Change at line 547 to add sorting of property descriptors.
                  
> 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
>         Attachments: DefaultSchemaGenerator.java
>
>
> 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