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 bu...@apache.org on 2003/07/08 03:03:43 UTC

DO NOT REPLY [Bug 21389] New: - WSDL2Java complex type array handling broke in v1.1 (worked in v1.0)

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21389>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21389

WSDL2Java complex type array handling broke in v1.1 (worked in v1.0)

           Summary: WSDL2Java complex type array handling broke in v1.1
                    (worked in v1.0)
           Product: Axis
           Version: 1.1
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Major
          Priority: Other
         Component: WSDL processing
        AssignedTo: axis-dev@ws.apache.org
        ReportedBy: d_axis@axonchisel.net


WSDL2Java generation of metadata in Java code for arrays of complex types no 
longer works (note that in 1.0, it did work!)!

The code generated indicates that the array type is the array element itself 
rather than the array type!  Here is what is generated now:

  elemField = new org.apache.axis.description.ElementDesc();
  elemField.setFieldName("balls");
  elemField.setXmlName(new javax.xml.namespace.QName("", "balls"));
  elemField.setXmlType(new javax.xml.namespace.QName 
    ("http://beans.test.com", "TestBall"));
  typeDesc.addFieldDesc(elemField);

Previously (the correct code, as generated by v1.0's WSDL2Java):

  field = new org.apache.axis.description.ElementDesc();
  field.setFieldName("balls");
  field.setXmlName(new javax.xml.namespace.QName("", "balls"));
  field.setXmlType(new javax.xml.namespace.QName
    ("http://service.test.com", "ArrayOf_tns2_TestBall"));
  typeDesc.addFieldDesc(field);

See the difference?  The XmlType is the "ArrayOf_tns2_TestBall", whereas now, 
it just gets "TestBall".  Note that the *rest* of the code is generated fine: 
the type is still an array, the setters/getters access the array properly, 
etc.  Just the metadata in the FieldDesc is wrong!

The result of this bug is that deserialization yields a parse failure when it 
sees the first "item" element of the array, since it's expecting the bean:
  org.xml.sax.SAXException: Invalid element in com.test.beans.BallSack - item 

Note that another user has recently indicated this problem on the mailing list 
as well:
  http://marc.theaimsgroup.com/?l=axis-user&m=105725790207423

This is a showstopper for anybody using complex arrays, especially those with 
WSDL2Java as part of the build process!