Issue Details (XML | Word | Printable)

Key: AXIS-2504
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Leif Mortenson
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Axis

ElementDesc class incorrect for String[]

Created: 19/Jun/06 01:37 PM   Updated: 19/Jun/06 01:37 PM
Return to search
Component/s: Deployment / Registries
Affects Version/s: 1.4
Fix Version/s: None

Time Tracking:
Not Specified


 Description  « Hide
I have a class which generates output based on the descriptor objects of a deployed web application. One of my operations take an object as a parameter. That object has a field of class String[]. The operation itself all works perfectly. However when I ElementDesc for that field getFields of the TypeDesc, the getXmlType() method always returns a QName that resolves to String.class.

From the API, it looks like the getArrayType() should be returning a QName which resolves to String[].class. In my case ArrayOf_xsd_string.

Looking at the code, the getArrayType method currently always returns null.

I was able to fix this by modifying the following class:

org.apache.axis.wsdl.toJava.JavaBeanHelperWriter:
-----
Index: D:/Apache/axis-1.x-svn/src/org/apache/axis/wsdl/toJava/JavaBeanHelperWriter.java
===================================================================
--- D:/Apache/axis-1.x-svn/src/org/apache/axis/wsdl/toJava/JavaBeanHelperWriter.java (revision 415249)
+++ D:/Apache/axis-1.x-svn/src/org/apache/axis/wsdl/toJava/JavaBeanHelperWriter.java (working copy)
@@ -328,13 +328,13 @@
                     // Some special handling for arrays.
                     TypeEntry elemType = elem.getType();
                     QName xmlType = null;
-
+ QName arrayType = null;
                     if ((elemType.getDimensions().length() > 1)
                             && (elemType.getClass() == DefinedType.class)) {
-
                         // If we have a DefinedType with dimensions, it must
                         // be a SOAP array derived type. In this case, use
                         // the refType's QName for the metadata.
+ arrayType = elemType.getQName();
                         elemType = elemType.getRefType();
                     } else if (elemType.getClass() == DefinedElement.class
                             && elemType.getRefType() != null) {
@@ -375,6 +375,10 @@
                         pw.println(" elemField.setXmlType("
                                 + Utils.getNewQName(xmlType) + ");");
                     }
+ if (arrayType != null) {
+ pw.println(" elemField.setArrayType("
+ + Utils.getNewQName(arrayType) + ");");
+ }
 
                     if (elem.getMinOccursIs0()) {
                         pw.println(" elemField.setMinOccurs(0);");
@@ -388,6 +392,7 @@
                     if(elem.getMaxOccursIsUnbounded()) {
                         pw.println(" elemField.setMaxOccursUnbounded(true);");
                     }
+
                     QName itemQName = elem.getType().getItemQName();
                     if (itemQName != null) {
                         pw.println(" elemField.setItemQName(" +
-----

Thanks,
Leif

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no entries against this issue.