JavaBeanWriter reorders variable names in generated constructors
----------------------------------------------------------------

         Key: AXIS-1873
         URL: http://issues.apache.org/jira/browse/AXIS-1873
     Project: Axis
        Type: Bug
  Components: WSDL processing  
    Versions: 1.2RC3    
 Environment: The WSDL2Java tool in Axis 1.2RC3
    Reporter: Mark Ayzenshtat


Parameter lists in constructors generated using WSDL2Java are now sorted 
alphabetically by variable name instead of having the order specified by the 
WSDL.  Although this behavior seems to result from a specific change (see diff 
link below), it strikes me as a bug.  I very much expect the variable order to 
be consistent with the WSDL, and this change not only breaks client code but 
disrupts intentional, logical  ordering of parameters.

Here's the change:
http://cvs.apache.org/viewcvs.cgi/ws-axis/java/src/org/apache/axis/wsdl/toJava/JavaBeanWriter.java?r1=1.71&r2=1.72

Consider the public WSDL: 
https://adwords.google.com/api/adwords/v2/AccountService?WSDL

The "Address" type consists of the following elements:
<element name="name" type="xsd:string"/>
<element name="companyName" type="xsd:string"/>
<element name="addressLine1" type="xsd:string"/>
<element name="addressLine2" nillable="true" type="xsd:string"/>
<element name="city" type="xsd:string"/>
<element name="state" nillable="true" type="xsd:string"/>
<element name="postalCode" type="xsd:string"/>
<element name="countryCode" type="xsd:string"/>
<element name="phoneNumber" type="xsd:string"/>
<element name="faxNumber" nillable="true" type="xsd:string"/>

It makes sense to have address, city, state, postal code, and country code 
listed in that order.  Unfortunately, WSDL2Java now produces a constructor with 
the following parameter list:
           java.lang.String addressLine1,
           java.lang.String addressLine2,
           java.lang.String city,
           java.lang.String companyName,
           java.lang.String countryCode,
           java.lang.String faxNumber,
           java.lang.String name,
           java.lang.String phoneNumber,
           java.lang.String postalCode,
           java.lang.String state

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira

Reply via email to