axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tom Jordahl" <>
Subject RE: Axis 1.4 WSDL2java error with primitive arrays
Date Wed, 25 Jul 2007 18:32:51 GMT
Hi Chul,


I would recommend you make your change and run all of the Axis 1.x unit
tests ("ant clean all-tests")  to see what breaks (if anything) because
of this change.  One of the problems we have always had in Axis 1.x is
that a "simple" change to fix one bug ends up breaking (as you saw)
another case.


Since this is an open source project and there is no dedicated test
engineering group, the confidence that we aren't breaking someone with
simple fixes gets lower and lower.  Especially since Axis 1.x is in
virtual stasis and the active development is happening on Axis2.


In any case, I would open a JIRA bug report, if you haven't already, and
place your patch in the bug - ensuring that it passes all tests when
built with the current SVN source.  For extra credit, you can write a
new unit test that demonstrates the problem and include that as part of
the patch.  This ensures that the bug will stay fixed in the future.


Thanks for your help.



Tom Jordahl



From: Chul Yoon [] 
Sent: Thursday, July 12, 2007 6:18 PM
Subject: Axis 1.4 WSDL2java error with primitive arrays


This is a really old bug that appeared in Axis 1.2 but did not exist in
Axis 1.1.

The same bug still exists in Axis 1.3 and Axis 1.4.

The same problem has been mentioned before:

That URL gives a good description of the problem.
I'll try to summarize this  briefly

If you have a WSDL (rpc/enc) that has a primitive array like int[],
double[], boolean[] that appears in your WSDL like this:

  <complexType name="ArrayOf_xsd_double">
          <restriction base="soapenc:Array">
             <attribute ref="soapenc:arrayType"

  <complexType name="MyClass">
         <element name="name" type="xsd:string" nillable="true"/>
         <element name="values" type="impl:ArrayOf_xsd_double"

When you generate the source files using wsdl2java, the primitive array
is incorrectly converted into it's primitive type.
So int[] gets converted to int, and double[] gets converted to double.
This will obviously not generate correct code for the client - it won't
work !!!!!

Producing incorrect and inoperable code for a client in my mind is a
Not sure what your definition of a showstopper is but it doesn't get
worse than that.

I fixed it in the class org.apache.axis.wsdl.toJava.JavaBeanHelperWriter
(Axis 1.4 source) by commenting out a line.
The code block begins at line 329:                

                    // Some special handling for arrays.
                    TypeEntry elemType = elem.getType();
                    QName xmlType = null;

                    if ((elemType.getDimensions().length() > 1)
                            && (elemType.getClass() ==
DefinedType.class)) {

                        // If we have a DefinedType with dimensions, it
                        // be a SOAP array derived type.  In this case,
                        // the refType's QName for the metadata.
IT'S A BUG !!!!!                       
                        // elemType = elemType.getRefType();
Even though this fix works in my case, I don't know what side effects it
will have.
The original author(s) had a reason to write it this way even though it
created a bug.

Please look into it and fix it one and for all.

This is not a minor bug !!!!!!!!!!

View raw message