Uploaded image for project: 'Axis'
  1. Axis
  2. AXIS-2504

ElementDesc class incorrect for String[]

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.4
    • None
    • None

    Description

      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

      Attachments

        Activity

          People

            Unassigned Unassigned
            mortenson Leif Mortenson
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: