You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by gd...@apache.org on 2005/04/12 14:28:33 UTC

cvs commit: ws-axis/java/tools/org/apache/axis/tools/ant/wsdl Wsdl2javaAntTask.java

gdaniels    2005/04/12 05:28:33

  Modified:    java/src/org/apache/axis/client Tag: LiteralArrayWork
                        Call.java
               java/src/org/apache/axis/description Tag: LiteralArrayWork
                        ElementDesc.java ParameterDesc.java
               java/src/org/apache/axis/encoding Tag: LiteralArrayWork
                        SerializationContext.java
               java/src/org/apache/axis/encoding/ser Tag: LiteralArrayWork
                        ArrayDeserializer.java ArraySerializer.java
                        BeanDeserializer.java BeanSerializer.java
               java/src/org/apache/axis/message Tag: LiteralArrayWork
                        MessageElement.java RPCElement.java RPCHandler.java
                        RPCParam.java
               java/src/org/apache/axis/utils Tag: LiteralArrayWork
                        BeanPropertyDescriptor.java
                        FieldPropertyDescriptor.java
               java/src/org/apache/axis/wsdl Tag: LiteralArrayWork
                        WSDL2Java.java
               java/src/org/apache/axis/wsdl/fromJava Tag: LiteralArrayWork
                        Emitter.java Types.java
               java/src/org/apache/axis/wsdl/gen Tag: LiteralArrayWork
                        Parser.java
               java/src/org/apache/axis/wsdl/symbolTable Tag:
                        LiteralArrayWork ElementDecl.java SchemaUtils.java
                        SymbolTable.java TypeEntry.java
               java/src/org/apache/axis/wsdl/toJava Tag: LiteralArrayWork
                        Emitter.java JavaBeanHelperWriter.java
                        JavaStubWriter.java
               java/test/message Tag: LiteralArrayWork
                        TestMessageElement.java
               java/test/wsdl/arrays3 Tag: LiteralArrayWork
                        AddrBookServiceImplServiceTestCase.java
               java/test/wsdl/clash Tag: LiteralArrayWork build.xml
               java/test/wsdl/interop4/groupH/simpleDocLit Tag:
                        LiteralArrayWork build.xml
               java/test/wsdl/marshall2 Tag: LiteralArrayWork build.xml
               java/test/wsdl/qnameser Tag: LiteralArrayWork build.xml
               java/test/wsdl/roundtrip Tag: LiteralArrayWork build.xml
               java/tools/org/apache/axis/tools/ant/wsdl Tag:
                        LiteralArrayWork Wsdl2javaAntTask.java
  Log:
  Checking in current state of literal array changes on a branch
  so Tom and I can easily share it this AM.
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.239.2.1 +1 -2      ws-axis/java/src/org/apache/axis/client/Call.java
  
  Index: Call.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/client/Call.java,v
  retrieving revision 1.239
  retrieving revision 1.239.2.1
  diff -u -r1.239 -r1.239.2.1
  --- Call.java	8 Feb 2005 18:44:36 -0000	1.239
  +++ Call.java	12 Apr 2005 12:28:29 -0000	1.239.2.1
  @@ -1593,7 +1593,6 @@
           // Make sure we're making a fresh start.
           this.setPortName( portName );
           this.setOperationName( opName );
  -        this.setEncodingStyle( null );
           this.setReturnType( null );
           this.removeAllParameters();
   
  @@ -2958,4 +2957,4 @@
           operation = null;
           operationSetManually = false;
       }
  -}
  +}
  \ No newline at end of file
  
  
  
  No                   revision
  No                   revision
  1.7.2.1   +22 -1     ws-axis/java/src/org/apache/axis/description/ElementDesc.java
  
  Index: ElementDesc.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/description/ElementDesc.java,v
  retrieving revision 1.7
  retrieving revision 1.7.2.1
  diff -u -r1.7 -r1.7.2.1
  --- ElementDesc.java	18 Nov 2004 17:00:40 -0000	1.7
  +++ ElementDesc.java	12 Apr 2005 12:28:30 -0000	1.7.2.1
  @@ -34,9 +34,14 @@
        * By default, element cannot be nillable. */
       private boolean nillable = false;
   
  +    /** maxOccurs="unbounded" */
  +    private boolean unbounded = false;
  +
       /** If this is an array, this holds the array type */
       private QName arrayType;
  -    
  +    /** If this is a "wrapped" array, this tells us the inner QName */
  +    private QName itemQName;
  +
       public ElementDesc() {
           super(true);
       }
  @@ -61,6 +66,14 @@
           this.maxOccurs = maxOccurs;
       }
   
  +    public void setMaxOccursUnbounded(boolean ubnd) {
  +        this.unbounded = ubnd;
  +    }
  +
  +    public boolean isMaxOccursUnbounded() {
  +        return unbounded;
  +    }
  +
       /**
        * Returns value of nillable property.
        *
  @@ -86,4 +99,12 @@
       public void setArrayType(QName arrayType) {
           this.arrayType = arrayType;
       }
  +
  +    public QName getItemQName() {
  +        return itemQName;
  +    }
  +
  +    public void setItemQName(QName itemQName) {
  +        this.itemQName = itemQName;
  +    }
   }
  
  
  
  1.31.4.1  +11 -0     ws-axis/java/src/org/apache/axis/description/ParameterDesc.java
  
  Index: ParameterDesc.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/description/ParameterDesc.java,v
  retrieving revision 1.31
  retrieving revision 1.31.4.1
  diff -u -r1.31 -r1.31.4.1
  --- ParameterDesc.java	8 Apr 2004 13:09:06 -0000	1.31
  +++ ParameterDesc.java	12 Apr 2005 12:28:30 -0000	1.31.4.1
  @@ -55,6 +55,10 @@
       private boolean isReturn = false;
       /** MIME type for this parameter, if there is one */
       private String mimeType = null;
  +    /** If this ParamDesc represents a literal array, this QName will
  +     * determine if it gets written as a "bare" or a "wrapped" schema.
  +     */
  +    private QName itemQName;
   
       /** Indicates whether input/output values are stored in the header */
       private boolean inHeader = false;
  @@ -332,4 +336,11 @@
           in.defaultReadObject();
       }
   
  +    public QName getItemQName() {
  +        return itemQName;
  +    }
  +
  +    public void setItemQName(QName itemQName) {
  +        this.itemQName = itemQName;
  +    }
   } // class ParameterDesc
  
  
  
  No                   revision
  No                   revision
  1.106.2.1 +10 -0     ws-axis/java/src/org/apache/axis/encoding/SerializationContext.java
  
  Index: SerializationContext.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/encoding/SerializationContext.java,v
  retrieving revision 1.106
  retrieving revision 1.106.2.1
  diff -u -r1.106 -r1.106.2.1
  --- SerializationContext.java	26 Feb 2005 21:37:33 -0000	1.106
  +++ SerializationContext.java	12 Apr 2005 12:28:30 -0000	1.106.2.1
  @@ -99,6 +99,8 @@
       private int lastPrefixIndex = 1;
       private MessageContext msgContext;
       private QName currentXMLType;
  +    /** The component QName if we're serializing a literal array... */
  +    private QName componentQName;
   
       /** The SOAP context we're using */
       private SOAPConstants soapConstants = SOAPConstants.SOAP11_CONSTANTS;
  @@ -1585,4 +1587,12 @@
       public void setEncoding(String encoding) {
           this.encoding = encoding;
       }
  +
  +    public QName getComponentQName() {
  +        return componentQName;
  +    }
  +
  +    public void setComponentQName(QName componentQName) {
  +        this.componentQName = componentQName;
  +    }
   }
  \ No newline at end of file
  
  
  
  No                   revision
  No                   revision
  1.46.2.1  +19 -13    ws-axis/java/src/org/apache/axis/encoding/ser/ArrayDeserializer.java
  
  Index: ArrayDeserializer.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/encoding/ser/ArrayDeserializer.java,v
  retrieving revision 1.46
  retrieving revision 1.46.2.1
  diff -u -r1.46 -r1.46.2.1
  --- ArrayDeserializer.java	18 Nov 2004 21:37:34 -0000	1.46
  +++ ArrayDeserializer.java	12 Apr 2005 12:28:30 -0000	1.46.2.1
  @@ -211,7 +211,12 @@
   
           // If no type QName and no defaultItemType qname, use xsd:anyType
           if (defaultItemType == null && typeQName == null) {
  -            defaultItemType = Constants.XSD_ANYTYPE;
  +            Class destClass = context.getDestinationClass();
  +            if (destClass != null && destClass.isArray()) {
  +                // This will get set OK down below...
  +            } else {
  +                defaultItemType = Constants.XSD_ANYTYPE;
  +            }
           }
           
           // Determine the class type for the array.
  @@ -240,24 +245,25 @@
                       }
                   } else {
                       dims += innerDimString;
  +                }
               }
  -        }
   
  -        arrayItemClass = context.getTypeMapping().getClassForQName(compQName);
  -        if (arrayItemClass != null) {
  -            try {
  -                String loadableArrayClassName = JavaUtils.getLoadableClassName(
  -                                                    JavaUtils.getTextClassName(arrayItemClass.getName()) + dims);
  -                arrayClass = ClassUtils.forName(loadableArrayClassName,
  +
  +            arrayItemClass = context.getTypeMapping().getClassForQName(compQName);
  +            if (arrayItemClass != null) {
  +                try {
  +                    String loadableArrayClassName = JavaUtils.getLoadableClassName(
  +                            JavaUtils.getTextClassName(arrayItemClass.getName()) + dims);
  +                    arrayClass = ClassUtils.forName(loadableArrayClassName,
                                                       true,
                                                       arrayItemClass.getClassLoader());
  -            } catch (Exception e) {
  -                throw new SAXException(
  -                   Messages.getMessage("noComponent00",  
  -                                        "" + defaultItemType));
  +                } catch (Exception e) {
  +                    throw new SAXException(
  +                            Messages.getMessage("noComponent00",
  +                                                "" + defaultItemType));
  +                }
               }
           }
  -        }
           if (arrayClass == null) {
               arrayClass = context.getDestinationClass();
           }
  
  
  
  1.64.2.1  +37 -22    ws-axis/java/src/org/apache/axis/encoding/ser/ArraySerializer.java
  
  Index: ArraySerializer.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/encoding/ser/ArraySerializer.java,v
  retrieving revision 1.64
  retrieving revision 1.64.2.1
  diff -u -r1.64 -r1.64.2.1
  --- ArraySerializer.java	8 Feb 2005 18:44:35 -0000	1.64
  +++ ArraySerializer.java	12 Apr 2005 12:28:30 -0000	1.64.2.1
  @@ -54,6 +54,7 @@
       QName xmlType;
       Class javaType;
       QName componentType;
  +    QName componentQName = Constants.QNAME_LITERAL_ITEM;
   
       /**
        * Constructor
  @@ -74,6 +75,18 @@
           this.componentType = componentType;
       }
   
  +    /**
  +     * Special constructor that takes the component type of the array AND
  +     * the QName of the array elements.
  +     */
  +    public ArraySerializer(Class javaType, QName xmlType,
  +                           QName componentType, QName componentQName) {
  +        this.javaType = javaType;
  +        this.xmlType = xmlType;
  +        this.componentType = componentType;
  +        this.componentQName = componentQName;
  +    }
  +
       protected static Log log =
           LogFactory.getLog(ArraySerializer.class.getName());
   
  @@ -139,38 +152,38 @@
   
           // Get the QName of the componentType
           // if it wasn't passed in from the constructor
  -        QName componentQName = this.componentType;
  +        QName componentTypeQName = this.componentType;
   
           // Try the current XML type from the context
  -        if (componentQName == null) {
  -            componentQName = context.getCurrentXMLType();
  -            if (componentQName != null) {
  -                if ((componentQName.equals(xmlType) ||
  -                     componentQName.equals(soap.getArrayType()))) {
  -                         componentQName = null;
  +        if (componentTypeQName == null) {
  +            componentTypeQName = context.getCurrentXMLType();
  +            if (componentTypeQName != null) {
  +                if ((componentTypeQName.equals(xmlType) ||
  +                     componentTypeQName.equals(soap.getArrayType()))) {
  +                         componentTypeQName = null;
                        }
               }
           }
   
           // Then check the type mapping for the class
  -        if (componentQName == null) {
  -            componentQName = context.getQNameForClass(componentClass);
  +        if (componentTypeQName == null) {
  +            componentTypeQName = context.getQNameForClass(componentClass);
           }
   
           // If still not found, look at the super classes
  -        if (componentQName == null) {
  +        if (componentTypeQName == null) {
               Class searchCls = componentClass;
  -            while(searchCls != null && componentQName == null) {
  +            while(searchCls != null && componentTypeQName == null) {
                   searchCls = searchCls.getSuperclass();
  -                componentQName = context.getQNameForClass(searchCls);
  +                componentTypeQName = context.getQNameForClass(searchCls);
               }
  -            if (componentQName != null) {
  +            if (componentTypeQName != null) {
                   componentClass = searchCls;
               }
           }
   
           // Still can't find it?  Throw an error.
  -        if (componentQName == null) {
  +        if (componentTypeQName == null) {
               throw new IOException(
                       Messages.getMessage("noType00", componentClass.getName()));
           }
  @@ -260,9 +273,10 @@
           // Need to distinguish if this is array processing for an
           // actual schema array or for a maxOccurs usage.
           // For the maxOccurs case, the currentXMLType of the context is
  -        // the same as the componentQName.
  -        boolean maxOccursUsage = !encoded &&
  -                componentQName.equals(context.getCurrentXMLType());
  +        // the same as the componentTypeQName.
  +        QName componentQName = context.getComponentQName();
  +        boolean maxOccursUsage = !encoded && componentQName == null &&
  +                componentTypeQName.equals(context.getCurrentXMLType());
   
           if (encoded) {
               AttributesImpl attrs;
  @@ -274,7 +288,7 @@
                   attrs = new AttributesImpl(attributes);
               }
   
  -            String compType = context.attributeQName2String(componentQName);
  +            String compType = context.attributeQName2String(componentTypeQName);
   
               if (attrs.getIndex(soap.getEncodingURI(), soap.getAttrItemType()) == -1) {
                   String encprefix =
  @@ -356,7 +370,8 @@
           if (!maxOccursUsage) {
               serializeAttr = null;  // since we are putting them here
               context.startElement(name, attributes);
  -            elementName = Constants.QNAME_LITERAL_ITEM;
  +            if (componentQName != null)
  +                elementName = componentQName;
               // If we are doing SOAP encoded arrays, no need to add xsi:type to the items
           }
   
  @@ -372,7 +387,7 @@
                               (serializeAttr == null ?
                               serializeAttr : new AttributesImpl(serializeAttr)),
                               aValue,
  -                            componentQName); // prefered type QName
  +                            componentTypeQName); // prefered type QName
                   }
               } else {
                   for (Iterator iterator = list.iterator(); iterator.hasNext();) {
  @@ -383,7 +398,7 @@
                               (serializeAttr == null ?
                               serializeAttr : new AttributesImpl(serializeAttr)),
                               aValue,
  -                            componentQName); // prefered type QName
  +                            componentTypeQName); // prefered type QName
                   }
               }
           } else {
  @@ -391,7 +406,7 @@
               for (int index = 0; index < len; index++) {
                   for (int index2 = 0; index2 < dim2Len; index2++) {
                       Object aValue = Array.get(Array.get(value, index), index2);
  -                    context.serialize(elementName, null, aValue, componentQName);
  +                    context.serialize(elementName, null, aValue, componentTypeQName);
                   }
               }
           }
  
  
  
  1.71.2.1  +26 -8     ws-axis/java/src/org/apache/axis/encoding/ser/BeanDeserializer.java
  
  Index: BeanDeserializer.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/encoding/ser/BeanDeserializer.java,v
  retrieving revision 1.71
  retrieving revision 1.71.2.1
  diff -u -r1.71 -r1.71.2.1
  --- BeanDeserializer.java	5 Feb 2005 00:14:32 -0000	1.71
  +++ BeanDeserializer.java	12 Apr 2005 12:28:30 -0000	1.71.2.1
  @@ -20,6 +20,7 @@
   import org.apache.axis.components.logger.LogFactory;
   import org.apache.axis.description.FieldDesc;
   import org.apache.axis.description.TypeDesc;
  +import org.apache.axis.description.ElementDesc;
   import org.apache.axis.encoding.DeserializationContext;
   import org.apache.axis.encoding.Deserializer;
   import org.apache.axis.encoding.DeserializerImpl;
  @@ -254,14 +255,29 @@
                                                               attributes);
   
           String href = attributes.getValue(soapConstants.getAttrHref());
  +        Class fieldType = propDesc.getType();
   
           // If no xsi:type or href, check the meta-data for the field
           if (childXMLType == null && fieldDesc != null && href == null) {
  -            childXMLType = fieldDesc.getXmlType();
  +            if (fieldDesc instanceof ElementDesc) {
  +                ElementDesc edesc = (ElementDesc)fieldDesc;
  +                QName itemQName = edesc.getItemQName();
  +                if (itemQName != null) {
  +                    // This is actually a wrapped literal array and should be
  +                    // deserialized with the ArrayDeserializer
  +                    childXMLType = Constants.SOAP_ARRAY;
  +                    fieldType = propDesc.getActualType();
  +                } else {
  +                    childXMLType = fieldDesc.getXmlType();
  +                }
  +            } else {
  +                childXMLType = fieldDesc.getXmlType();
  +            }
           }
           
           // Get Deserializer for child, default to using DeserializerImpl
  -        Deserializer dSer = getDeserializer(childXMLType, propDesc.getType(), 
  +        Deserializer dSer = getDeserializer(childXMLType,
  +                                            fieldType,
                                               href,
                                               context);
   
  @@ -275,9 +291,8 @@
   
           // Fastpath nil checks...
           if (context.isNil(attributes)) {
  -            if (propDesc != null && propDesc.isIndexed()) { 
  -                if (!((dSer != null) && (dSer instanceof ArrayDeserializer)) ||
  -                        propDesc.getType().isArray()) {
  +            if (propDesc != null && propDesc.isIndexedOrArray()) {
  +                if (!((dSer != null) && (dSer instanceof ArrayDeserializer))) {
                       collectionIndex++;
                       dSer.registerValueTarget(new BeanPropertyTarget(value,
                               propDesc, collectionIndex));
  @@ -308,9 +323,12 @@
               // In this case, we want to use the collectionIndex and make sure
               // the deserialized value for the child element goes into the
               // right place in the collection.
  -            if (propDesc.isIndexed() && (
  -                    !(dSer instanceof ArrayDeserializer) || 
  -                    propDesc.getType().isArray())) {
  +
  +            // list of deserializers that shouldn't use the indexed way to recreate the Bean
  +            boolean shouldUseArray = (!(dSer instanceof ArrayDeserializer) &&
  +                    !(dSer instanceof Base64Deserializer) &&
  +                    !(dSer instanceof HexDeserializer));
  +            if (propDesc.isIndexedOrArray() && shouldUseArray) {
                       collectionIndex++;
                       dSer.registerValueTarget(new BeanPropertyTarget(value,
                                                       propDesc, collectionIndex));
  
  
  
  1.84.2.1  +42 -14    ws-axis/java/src/org/apache/axis/encoding/ser/BeanSerializer.java
  
  Index: BeanSerializer.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/encoding/ser/BeanSerializer.java,v
  retrieving revision 1.84
  retrieving revision 1.84.2.1
  diff -u -r1.84 -r1.84.2.1
  --- BeanSerializer.java	21 Mar 2005 12:37:20 -0000	1.84
  +++ BeanSerializer.java	12 Apr 2005 12:28:30 -0000	1.84.2.1
  @@ -140,6 +140,9 @@
                   boolean isOmittable = false;
                   // isNillable default value depends on the field type
                   boolean isNillable = Types.isNullable(javaType);
  +                // isArray
  +                boolean isArray = false;
  +                QName itemQName = null;
   
                   // If we have type metadata, check to see what we're doing
                   // with this field.  If it's an attribute, skip it.  If it's
  @@ -164,7 +167,10 @@
                           }
                           isOmittable = element.isMinOccursZero();
                           isNillable = element.isNillable();
  +                        isArray = element.isMaxOccursUnbounded();
                           xmlType = element.getXmlType();
  +                        itemQName = element.getItemQName();
  +                        context.setComponentQName(itemQName);
                       }
                   }
   
  @@ -179,8 +185,9 @@
                   }
   
                   // Read the value from the property
  -                if(propertyDescriptor[i].isReadable()) {
  -                    if (!propertyDescriptor[i].isIndexed()) {
  +                if (propertyDescriptor[i].isReadable()) {
  +                    if (itemQName != null ||
  +                            (!propertyDescriptor[i].isIndexed() && !isArray)) {
                           // Normal case: serialize the value
                           Object propValue =
                               propertyDescriptor[i].get(value);
  @@ -397,18 +404,19 @@
                                      fieldType,
                                      propertyDescriptor[i].isIndexed(),
                                      field.isMinOccursZero(),
  -                                   all, isAnonymous);
  +                                   all, isAnonymous,
  +                                   ((ElementDesc)field).getItemQName());
                       }
                   } else {
                       writeField(types,
                                  propName,
                                  null,
                                  fieldType,
  -                               propertyDescriptor[i].isIndexed(), false, all, false);
  +                               propertyDescriptor[i].isIndexed(), false, all, false, null);
                   }
               } else {
                   boolean done = false;
  -                if(propertyDescriptor[i] instanceof FieldPropertyDescriptor){
  +                if (propertyDescriptor[i] instanceof FieldPropertyDescriptor){
                       FieldPropertyDescriptor fpd = (FieldPropertyDescriptor) propertyDescriptor[i];
                       Class clazz = fpd.getField().getType();
                       if(types.getTypeQName(clazz)!=null) {
  @@ -416,7 +424,7 @@
                                      propName,
                                      null,
                                      clazz,
  -                                   false, false, all, false);
  +                                   false, false, all, false, null);
                      
                           done = true;
                       }
  @@ -426,7 +434,7 @@
                                  propName,
                                  null,
                                  propertyDescriptor[i].getType(),
  -                               propertyDescriptor[i].isIndexed(), false, all, false);
  +                               propertyDescriptor[i].isIndexed(), false, all, false, null);
                   }                    
                   
               }
  @@ -444,6 +452,7 @@
        * @param fieldType type of the field
        * @param isUnbounded causes maxOccurs="unbounded" if set
        * @param where location for the generated schema node
  +     * @param itemQName
        * @throws Exception
        */
       protected void writeField(Types types,
  @@ -453,22 +462,41 @@
                                 boolean isUnbounded,
                                 boolean isOmittable,
                                 Element where,
  -                              boolean isAnonymous) throws Exception {
  +                              boolean isAnonymous,
  +                              QName itemQName) throws Exception {
           Element elem;
  +        String elementType = null;
  +
           if (isAnonymous) {
  -            elem = types.createElementWithAnonymousType(fieldName,
  -            fieldType, isOmittable, where.getOwnerDocument());
  +            elem = types.
  +                    createElementWithAnonymousType(fieldName,
  +                                                   fieldType,
  +                                                   isOmittable,
  +                                                   where.getOwnerDocument());
  +//        } else if (itemQName != null) {
  +//            // This is a "wrapped" literal array, so write the element with
  +//            // an anonymous complexType containing a sequence containing
  +//            // an element of the right type with maxOccurs="unbounded"
  +//            elem = types.createElement(fieldName, null, false, false, where.getOwnerDocument());
  +//            String typeName = types.writeType(fieldType);
  +//            Element complexType = types.createLiteralArrayElement(typeName,
  +//                                                                  itemQName);
  +//            elem.appendChild(complexType);
  +//            where.appendChild(elem);
  +//            return;
           } else {
  -            if (!SchemaUtils.isSimpleSchemaType(xmlType) && Types.isArray(fieldType)) {
  +            if (!SchemaUtils.isSimpleSchemaType(xmlType) &&
  +                    Types.isArray(fieldType)) {
                   xmlType = null;
               }
               
  -            String elementType = types.writeType(fieldType, xmlType);
  +            elementType = types.writeType(fieldType, xmlType);
   
               if (elementType == null) {
  -                // If writeType returns null, then emit an anytype in such situations.
  +                // If writeType returns null, then emit an anytype.
                   QName anyQN = Constants.XSD_ANYTYPE;
  -                String prefix = types.getNamespaces().getCreatePrefix(anyQN.getNamespaceURI());
  +                String prefix = types.getNamespaces().
  +                        getCreatePrefix(anyQN.getNamespaceURI());
                   elementType = prefix + ":" + anyQN.getLocalPart();
               }
   
  
  
  
  No                   revision
  No                   revision
  1.195.2.1 +1 -1      ws-axis/java/src/org/apache/axis/message/MessageElement.java
  
  Index: MessageElement.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/message/MessageElement.java,v
  retrieving revision 1.195
  retrieving revision 1.195.2.1
  diff -u -r1.195 -r1.195.2.1
  --- MessageElement.java	18 Feb 2005 13:03:58 -0000	1.195
  +++ MessageElement.java	12 Apr 2005 12:28:30 -0000	1.195.2.1
  @@ -2014,7 +2014,7 @@
                   att.getNamespaceURI().equals(Constants.NS_URI_XMLNS) &&
                   "xmlns".equals(att.getPrefix())) {
                   Mapping map = new Mapping(att.getNodeValue(), att.getLocalName());
  -                addMapping(map);
  +                dest.addMapping(map);
               }
               if(att.getLocalName() != null) {
                   dest.addAttribute(att.getPrefix(),
  
  
  
  1.100.2.1 +0 -2      ws-axis/java/src/org/apache/axis/message/RPCElement.java
  
  Index: RPCElement.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/message/RPCElement.java,v
  retrieving revision 1.100
  retrieving revision 1.100.2.1
  diff -u -r1.100 -r1.100.2.1
  --- RPCElement.java	8 Feb 2005 18:44:36 -0000	1.100
  +++ RPCElement.java	12 Apr 2005 12:28:30 -0000	1.100.2.1
  @@ -62,8 +62,6 @@
           // This came from parsing XML, so we need to deserialize it sometime
           needDeser = true;
   
  -        MessageContext msgContext = context.getMessageContext();
  -
           // Obtain our possible operations
           if (operations == null) {
               updateOperationsByName();
  
  
  
  1.81.2.1  +7 -0      ws-axis/java/src/org/apache/axis/message/RPCHandler.java
  
  Index: RPCHandler.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/message/RPCHandler.java,v
  retrieving revision 1.81
  retrieving revision 1.81.2.1
  diff -u -r1.81 -r1.81.2.1
  --- RPCHandler.java	6 Dec 2004 06:38:23 -0000	1.81
  +++ RPCHandler.java	12 Apr 2005 12:28:30 -0000	1.81.2.1
  @@ -23,6 +23,7 @@
   
   import org.apache.axis.AxisFault;
   import org.apache.axis.Constants;
  +import org.apache.axis.constants.Style;
   import org.apache.axis.components.logger.LogFactory;
   import org.apache.axis.description.OperationDesc;
   import org.apache.axis.description.ParameterDesc;
  @@ -252,6 +253,12 @@
               dser = context.getDeserializerForType(qname);
           } else {
               dser = context.getDeserializer(destClass, type);
  +            // !!!
  +            if (dser == null && destClass.isArray() &&
  +                    operation.getStyle() == Style.DOCUMENT) {
  +                dser = context.getDeserializerForClass(destClass);
  +            }
  +            // !!!
           }
           
           if (dser == null) {
  
  
  
  1.63.2.1  +11 -0     ws-axis/java/src/org/apache/axis/message/RPCParam.java
  
  Index: RPCParam.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/message/RPCParam.java,v
  retrieving revision 1.63
  retrieving revision 1.63.2.1
  diff -u -r1.63 -r1.63.2.1
  --- RPCParam.java	4 Feb 2005 03:42:45 -0000	1.63
  +++ RPCParam.java	12 Apr 2005 12:28:30 -0000	1.63.2.1
  @@ -20,6 +20,9 @@
   import org.apache.axis.encoding.SerializationContext;
   import org.apache.axis.utils.JavaUtils;
   import org.apache.axis.utils.Messages;
  +import org.apache.axis.constants.Style;
  +import org.apache.axis.Constants;
  +import org.apache.axis.MessageContext;
   import org.apache.commons.logging.Log;
   
   import javax.xml.namespace.QName;
  @@ -182,6 +185,14 @@
                   }
               }
               xmlType = paramDesc.getTypeQName();
  +            QName itemQName = paramDesc.getItemQName();
  +            if (itemQName == null) {
  +                MessageContext mc = context.getMessageContext();
  +                if (mc != null && mc.getOperation() != null && mc.getOperation().getStyle() == Style.DOCUMENT) {
  +                    itemQName = Constants.QNAME_LITERAL_ITEM;
  +                }
  +            }
  +            context.setComponentQName(itemQName);
           }
           context.serialize(getQName(),  // element qname
                             null,   // no extra attrs
  
  
  
  No                   revision
  No                   revision
  1.20.2.1  +4 -0      ws-axis/java/src/org/apache/axis/utils/BeanPropertyDescriptor.java
  
  Index: BeanPropertyDescriptor.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/utils/BeanPropertyDescriptor.java,v
  retrieving revision 1.20
  retrieving revision 1.20.2.1
  diff -u -r1.20 -r1.20.2.1
  --- BeanPropertyDescriptor.java	4 Feb 2005 03:41:43 -0000	1.20
  +++ BeanPropertyDescriptor.java	12 Apr 2005 12:28:30 -0000	1.20.2.1
  @@ -218,4 +218,8 @@
               return myPD.getPropertyType();
           }
       }
  +
  +    public Class getActualType() {
  +        return myPD.getPropertyType();
  +    }
   }
  
  
  
  1.8.4.1   +4 -0      ws-axis/java/src/org/apache/axis/utils/FieldPropertyDescriptor.java
  
  Index: FieldPropertyDescriptor.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/utils/FieldPropertyDescriptor.java,v
  retrieving revision 1.8
  retrieving revision 1.8.4.1
  diff -u -r1.8 -r1.8.4.1
  --- FieldPropertyDescriptor.java	12 Apr 2004 03:30:59 -0000	1.8
  +++ FieldPropertyDescriptor.java	12 Apr 2005 12:28:30 -0000	1.8.4.1
  @@ -143,6 +143,10 @@
           }
       }
   
  +    public Class getActualType() {
  +        return field.getType();
  +    }
  +
       public Field getField() {
           return field;
       }
  
  
  
  No                   revision
  No                   revision
  1.55.2.1  +13 -2     ws-axis/java/src/org/apache/axis/wsdl/WSDL2Java.java
  
  Index: WSDL2Java.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/wsdl/WSDL2Java.java,v
  retrieving revision 1.55
  retrieving revision 1.55.2.1
  diff -u -r1.55 -r1.55.2.1
  --- WSDL2Java.java	8 Feb 2005 18:44:38 -0000	1.55
  +++ WSDL2Java.java	12 Apr 2005 12:28:31 -0000	1.55.2.1
  @@ -92,6 +92,9 @@
   
       /** Field ALLOW_INVALID_URL_OPT */
       protected static final int ALLOW_INVALID_URL_OPT = 'u';
  +    
  +    /** */
  +    protected static final int UNWRAP_ARRAYS_OPT = 'w';
   
       /** Field emitter */
       private Emitter emitter;
  @@ -178,7 +181,11 @@
   						IMPL_CLASS_OPT,
   						Messages.getMessage("implementationClassName")),
                   new CLOptionDescriptor("allowInvalidURL", CLOptionDescriptor.ARGUMENT_DISALLOWED,
  -                        ALLOW_INVALID_URL_OPT, Messages.getMessage("optionAllowInvalidURL"))
  +                        ALLOW_INVALID_URL_OPT, Messages.getMessage("optionAllowInvalidURL")),
  +                new CLOptionDescriptor("unwrapArrays",
  +                                       CLOptionDescriptor.ARGUMENT_OPTIONAL,
  +                                       UNWRAP_ARRAYS_OPT,
  +                                       Messages.getMessage("optionUnwrapArrays")),
                   };
   
       /**
  @@ -322,7 +329,11 @@
               case ALLOW_INVALID_URL_OPT:
                   emitter.setAllowInvalidURL(true);
                   break;
  -                
  +
  +            case UNWRAP_ARRAYS_OPT:
  +                emitter.setUnwrapArrays(false);
  +                break;
  +
               default :
                   super.parseOption(option);
           }
  
  
  
  No                   revision
  No                   revision
  1.142.2.1 +6 -3      ws-axis/java/src/org/apache/axis/wsdl/fromJava/Emitter.java
  
  Index: Emitter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/wsdl/fromJava/Emitter.java,v
  retrieving revision 1.142
  retrieving revision 1.142.2.1
  diff -u -r1.142 -r1.142.2.1
  --- Emitter.java	25 Mar 2005 10:02:19 -0000	1.142
  +++ Emitter.java	12 Apr 2005 12:28:31 -0000	1.142.2.1
  @@ -1449,7 +1449,7 @@
               // TODO: Support custom schema in WSDD for these operations
               QName qname = oper.getElementQName();
               types.writeElementDecl(qname, Object.class,
  -                    Constants.XSD_ANYTYPE, false, false);
  +                                   Constants.XSD_ANYTYPE, false, null);
   
               Part part = def.createPart();
   
  @@ -1927,8 +1927,11 @@
               }
               names.add(qname.getLocalPart());
   
  -            types.writeElementDecl(qname, param.getJavaType(),
  -                    param.getTypeQName(), false, false);
  +            types.writeElementDecl(qname,
  +                                   param.getJavaType(),
  +                                   param.getTypeQName(),
  +                                   false,
  +                                   param.getItemQName());
   
               part.setName(param.getName());
               part.setElementName(qname);
  
  
  
  1.112.2.1 +32 -13    ws-axis/java/src/org/apache/axis/wsdl/fromJava/Types.java
  
  Index: Types.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/wsdl/fromJava/Types.java,v
  retrieving revision 1.112
  retrieving revision 1.112.2.1
  diff -u -r1.112 -r1.112.2.1
  --- Types.java	21 Mar 2005 12:37:20 -0000	1.112
  +++ Types.java	12 Apr 2005 12:28:31 -0000	1.112.2.1
  @@ -23,7 +23,6 @@
   import org.apache.axis.components.logger.LogFactory;
   import org.apache.axis.constants.Style;
   import org.apache.axis.description.ServiceDesc;
  -import org.apache.axis.encoding.DefaultJAXRPC11TypeMappingImpl;
   import org.apache.axis.encoding.Serializer;
   import org.apache.axis.encoding.SerializerFactory;
   import org.apache.axis.encoding.SimpleType;
  @@ -1060,18 +1059,23 @@
        * a SOAP-encoded array.
        *
        * @param componentType
  -     * @param itemName
  +     * @param itemName the QName of the inner element (right now we only use the localPart)
        * @return
        */
       public Element createLiteralArrayElement(String componentType,
                                                QName itemName) {
  +        String itemLocalName = "item";
  +        if (itemName != null) {
  +            itemLocalName = itemName.getLocalPart();
  +        }
  +
           Element complexType = docHolder.createElement("complexType");
           Element sequence = docHolder.createElement("sequence");
   
           complexType.appendChild(sequence);
   
           Element elem = docHolder.createElement("element");
  -        elem.setAttribute("name", "item");
  +        elem.setAttribute("name", itemLocalName);
           elem.setAttribute("type", componentType);
           elem.setAttribute("minOccurs", "0");
           elem.setAttribute("maxOccurs", "unbounded");
  @@ -1186,20 +1190,20 @@
       }
   
       /**
  -     * Create Element
  +     * Create a top-level element declaration in our generated schema
        *
        * @param qname
        * @param javaType
        * @param typeQName
        * @param nillable  nillable attribute of the element
  -     * @param omittable
  +     * @param itemQName
        * @throws AxisFault
        */
       public void writeElementDecl(QName qname,
                                    Class javaType,
                                    QName typeQName,
                                    boolean nillable,
  -                                 boolean omittable)
  +                                 QName itemQName)
               throws AxisFault {
   
           if (writtenElementQNames.contains(qname)) {
  @@ -1217,6 +1221,9 @@
               element.setAttribute("nillable", "true");
           }
   
  +        /*
  +         * These are not legal on top-level elements!
  +         * (feel free to delete this block after say Oct 2005)
           if (omittable) {
               element.setAttribute("minOccurs", "0");
               element.setAttribute("maxOccurs", "1");
  @@ -1225,10 +1232,19 @@
           if (javaType.isArray()) {
               element.setAttribute("maxOccurs", "unbounded");
           }
  +        */
   
  -        // Write the type for this element, handling anonymous or named
  -        // types appropriately.
  -        makeTypeElement(javaType, typeQName, element);
  +        if (javaType.isArray()) {
  +            // TODO : Should check to see if this array type is specifically mapped
  +            String componentType = writeType(javaType.getComponentType());
  +            Element complexType = createLiteralArrayElement(componentType,
  +                                                            itemQName);
  +            element.appendChild(complexType);
  +        } else {
  +            // Write the type for this element, handling anonymous or named
  +            // types appropriately.
  +            makeTypeElement(javaType, typeQName, element);
  +        }
   
           writeSchemaElementDecl(qname, element);
       }
  @@ -1703,8 +1719,10 @@
        * @return
        * @throws AxisFault
        */
  -    public Element createElementWithAnonymousType(
  -            String elementName, Class fieldType, boolean omittable, Document ownerDocument)
  +    public Element createElementWithAnonymousType(String elementName,
  +                                                  Class fieldType,
  +                                                  boolean omittable,
  +                                                  Document ownerDocument)
               throws AxisFault {
   
           Element element = docHolder.createElement("element");
  @@ -1743,8 +1761,9 @@
        * @return true if the type was already present or was added, false if there was a problem
        * @throws AxisFault
        */
  -    private boolean makeTypeElement(
  -            Class type, QName qName, Element containingElement)
  +    private boolean makeTypeElement(Class type,
  +                                    QName qName,
  +                                    Element containingElement)
               throws AxisFault {
   
           // Get a corresponding QName if one is not provided
  
  
  
  No                   revision
  No                   revision
  1.22.4.1  +4 -0      ws-axis/java/src/org/apache/axis/wsdl/gen/Parser.java
  
  Index: Parser.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/wsdl/gen/Parser.java,v
  retrieving revision 1.22
  retrieving revision 1.22.4.1
  diff -u -r1.22 -r1.22.4.1
  --- Parser.java	12 Apr 2004 18:17:31 -0000	1.22
  +++ Parser.java	12 Apr 2005 12:28:31 -0000	1.22.4.1
  @@ -66,6 +66,9 @@
       /** Field password */
       protected String password = null;
   
  +    /** If this is true, we'll prefer "String[]" to "ArrayOfString" for literal wrapped arrays */
  +    protected boolean unwrapArrays = true;
  +
       // Timeout, in milliseconds, to let the Emitter do its work
   
       /** Field timeoutms */
  @@ -293,6 +296,7 @@
           symbolTable = new SymbolTable(genFactory.getBaseTypeMapping(), imports,
                   verbose, nowrap);
           symbolTable.setQuiet(quiet);
  +        symbolTable.setUnwrapArrays(unwrapArrays);
   
           // We run the actual Emitter in a thread that we can kill
           WSDLRunnable runnable = new WSDLRunnable(symbolTable, wsdlURI);
  
  
  
  No                   revision
  No                   revision
  1.10.2.1  +30 -10    ws-axis/java/src/org/apache/axis/wsdl/symbolTable/ElementDecl.java
  
  Index: ElementDecl.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/wsdl/symbolTable/ElementDecl.java,v
  retrieving revision 1.10
  retrieving revision 1.10.2.1
  diff -u -r1.10 -r1.10.2.1
  --- ElementDecl.java	2 Sep 2004 12:15:58 -0000	1.10
  +++ ElementDecl.java	12 Apr 2005 12:28:31 -0000	1.10.2.1
  @@ -52,21 +52,23 @@
       /** Field anyElement */
       private boolean anyElement = false;
   
  +    /** Field maxOccursIsUnbounded */
  +    private boolean maxOccursIsUnbounded = false;
   
       /**
        * Constructor ElementDecl
  -     * 
  -     * @param type 
  -     * @param name 
  +     *
  +     * @param type
  +     * @param name
        */
       public ElementDecl(TypeEntry type, QName name) {
           super(type, name);
  -    }    
  +    }
   
       /**
        * Method getMinOccursIs0
  -     * 
  -     * @return 
  +     *
  +     * @return
        */
       public boolean getMinOccursIs0() {
           return minOccursIs0;
  @@ -74,17 +76,35 @@
   
       /**
        * Method setMinOccursIs0
  -     * 
  -     * @param minOccursIs0 
  +     *
  +     * @param minOccursIs0
        */
       public void setMinOccursIs0(boolean minOccursIs0) {
           this.minOccursIs0 = minOccursIs0;
       }
   
       /**
  +     * Method getMaxOccursIsUnbounded
  +     *
  +     * @return
  +     */
  +    public boolean getMaxOccursIsUnbounded() {
  +        return maxOccursIsUnbounded;
  +    }
  +
  +    /**
  +     * Method setMinOccursIsUnbounded
  +     *
  +     * @param maxOccursIsUnbounded
  +     */
  +    public void setMaxOccursIsUnbounded(boolean maxOccursIsUnbounded) {
  +        this.maxOccursIsUnbounded = maxOccursIsUnbounded;
  +    }
  +
  +    /**
        * Method setNillable
  -     * 
  -     * @param nillable 
  +     *
  +     * @param nillable
        */
       public void setNillable(boolean nillable) {
           this.nillable = nillable;
  
  
  
  1.53.2.1  +70 -11    ws-axis/java/src/org/apache/axis/wsdl/symbolTable/SchemaUtils.java
  
  Index: SchemaUtils.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/wsdl/symbolTable/SchemaUtils.java,v
  retrieving revision 1.53
  retrieving revision 1.53.2.1
  diff -u -r1.53 -r1.53.2.1
  --- SchemaUtils.java	24 Mar 2005 21:43:11 -0000	1.53
  +++ SchemaUtils.java	12 Apr 2005 12:28:31 -0000	1.53.2.1
  @@ -16,6 +16,7 @@
   package org.apache.axis.wsdl.symbolTable;
   
   import org.apache.axis.Constants;
  +import org.apache.axis.AxisProperties;
   import org.apache.axis.utils.JavaUtils;
   import org.w3c.dom.DOMException;
   import org.w3c.dom.Element;
  @@ -25,6 +26,7 @@
   import javax.xml.namespace.QName;
   import javax.xml.rpc.holders.BooleanHolder;
   import javax.xml.rpc.holders.IntHolder;
  +import javax.xml.rpc.holders.QNameHolder;
   import java.util.Arrays;
   import java.util.HashSet;
   import java.util.Set;
  @@ -593,9 +595,9 @@
                       elem.setAnyElement(true);
                       v.add(elem);
                   } else if (localName.equals("element")) {
  -                    ElementDecl elem = processChildElementNode(kid, 
  +                    ElementDecl elem = processChildElementNode(kid,
                                                                  symbolTable);
  -                    
  +
                       if (elem != null) {
                           v.add(elem);
                       }
  @@ -1249,15 +1251,18 @@
        * 
        * @param node is the node
        * @param dims is the output value that contains the number of dimensions if return is not null
  +     * @param itemQName will end up containing the "inner" QName for a
  +     *                       wrapped literal array
        * @return QName or null
        */
       public static QName getArrayComponentQName(Node node,
                                                  IntHolder dims,
  +                                               QNameHolder itemQName,
                                                  SymbolTable symbolTable) {
   
           dims.value = 1;    // assume 1 dimension
   
  -        QName qName = getCollectionComponentQName(node);
  +        QName qName = getCollectionComponentQName(node, itemQName);
   
           if (qName == null) {
               qName = getArrayComponentQName_JAXRPC(node, dims, symbolTable);
  @@ -1272,32 +1277,86 @@
        * <p/>
        * <xsd:element name="alias" type="xsd:string" maxOccurs="unbounded"/>
        * returns qname for"xsd:string"
  +     * <p/>
  +     * <xsd:complexType>
  +     *  <xsd:sequence>
  +     *   <xsd:element name="alias" type="xsd:string" maxOccurs="unbounded"/>
  +     *  </xsd:sequence>
  +     * </xsd:complexType>
  +     * returns qname for"xsd:string"
  +     * <p/>
        * <xsd:element ref="alias"  maxOccurs="unbounded"/>
        * returns qname for "alias"
        * 
        * @param node is the Node
        * @return QName of the compoent of the collection
        */
  -    public static QName getCollectionComponentQName(Node node) {
  +    public static QName getCollectionComponentQName(Node node,
  +                                                    QNameHolder itemQName) {
  +        // If we're going to turn "wrapped" arrays into types such that
  +        // <complexType><sequence>
  +        //   <element name="foo" type="xs:string" maxOccurs="unbounded"/>
  +        // </sequence></complexType>
  +        // becomes just "String []", we need to keep track of the inner
  +        // element name "foo" in metadata... This flag indicates whether to
  +        // do so.
  +        boolean storeComponentQName = false;
   
           if (node == null) {
               return null;
           }
   
  -        // If the node kind is an element, dive get its type.
  +        if (itemQName != null && isXSDNode(node, "complexType")) {
  +            // If this complexType is a sequence of exactly one element
  +            // we will continue processing below using that element, and
  +            // let the type checking logic determine if this is an array
  +            // or not.
  +            Node sequence = SchemaUtils.getChildByName(node, "sequence");
  +            if (sequence == null) {
  +                return null;
  +            }
  +            NodeList children = sequence.getChildNodes();
  +            Node element = null;
  +            for (int i = 0; i < children.getLength(); i++) {
  +                if (children.item(i).getNodeType() == Node.ELEMENT_NODE) {
  +                    if (element == null) {
  +                        element = children.item(i);
  +                    } else {
  +                        return null;
  +                    }
  +                }
  +            }
  +            if (element == null) {
  +                return null;
  +            }
  +
  +            // OK, exactly one element child of <sequence>,
  +            // continue the processing using that element ...
  +            node = element;
  +            storeComponentQName = true;
  +        }
  +
  +        // If the node kind is an element, dive to get its type.
           if (isXSDNode(node, "element")) {
   
               // Compare the componentQName with the name of the
               // full name.  If different, return componentQName
               BooleanHolder forElement = new BooleanHolder();
  -            QName componentQName = Utils.getTypeQName(node, forElement,
  -                    true);
  +            QName componentTypeQName = Utils.getTypeQName(node,
  +                                                          forElement,
  +                                                          true);
   
  -            if (componentQName != null) {
  +            if (componentTypeQName != null) {
                   QName fullQName = Utils.getTypeQName(node, forElement, false);
   
  -                if (!componentQName.equals(fullQName)) {
  -                    return componentQName;
  +                if (!componentTypeQName.equals(fullQName)) {
  +                    if (storeComponentQName) {
  +                        String name = Utils.getAttribute(node, "name");
  +                        if (name != null) {
  +                            itemQName.value = new QName("", name);
  +                        }
  +                    }
  +                    return componentTypeQName;
                   }
               }
           }
  @@ -1979,4 +2038,4 @@
           }
           return null;
       }
  -}
  +}
  \ No newline at end of file
  
  
  
  1.117.2.1 +29 -3     ws-axis/java/src/org/apache/axis/wsdl/symbolTable/SymbolTable.java
  
  Index: SymbolTable.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/wsdl/symbolTable/SymbolTable.java,v
  retrieving revision 1.117
  retrieving revision 1.117.2.1
  diff -u -r1.117 -r1.117.2.1
  --- SymbolTable.java	24 Mar 2005 21:43:11 -0000	1.117
  +++ SymbolTable.java	12 Apr 2005 12:28:31 -0000	1.117.2.1
  @@ -61,6 +61,7 @@
   import javax.xml.parsers.ParserConfigurationException;
   import javax.xml.rpc.holders.BooleanHolder;
   import javax.xml.rpc.holders.IntHolder;
  +import javax.xml.rpc.holders.QNameHolder;
   import java.io.File;
   import java.io.IOException;
   import java.net.MalformedURLException;
  @@ -165,7 +166,13 @@
   
       /** Field wsdlURI */
       private String wsdlURI = null;
  -    
  +
  +    /** If this is true, we will "unwrap" literal arrays, generating a plan "String[]" instead
  +     * of "ArrayOfString" when encountering an element containing a single maxOccurs="unbounded"
  +     * inner element.
  +     */
  +    private boolean unwrapArrays;
  +
       Set arrayTypeQNames = new HashSet();
   
       /**
  @@ -1166,10 +1173,17 @@
                   // See if this is an array or simple type definition.
                   IntHolder numDims = new IntHolder();
   
  +                // If we're supposed to unwrap arrays, supply someplace to put the "inner" QName
  +                // so we can propagate it into the appropriate metadata container.
  +                QNameHolder componentQName = unwrapArrays ? new QNameHolder() : null;
  +
                   numDims.value = 0;
   
                   QName arrayEQName = 
  -                        SchemaUtils.getArrayComponentQName(node, numDims, this);
  +                        SchemaUtils.getArrayComponentQName(node,
  +                                                           numDims,
  +                                                           componentQName,
  +                                                           this);
   
                   if (arrayEQName != null) {
   
  @@ -1210,11 +1224,15 @@
                                  new DefinedElement(qName, refType, node, dims);
                               // Save component type for ArraySerializer
                               defType.setComponentType(arrayEQName);
  +                            if (componentQName != null)
  +                                defType.setComponentQName(componentQName.value);
                           }
                       } else {
                           defType = new DefinedType(qName, refType, node, dims);
                           // Save component type for ArraySerializer
                           defType.setComponentType(arrayEQName);
  +                        if (componentQName != null)
  +                            defType.setComponentQName(componentQName.value);
                       }
   
                       if (defType != null) {
  @@ -3667,7 +3685,7 @@
               return null;
           }
   
  -        QName name = SchemaUtils.getCollectionComponentQName(node);
  +        QName name = SchemaUtils.getCollectionComponentQName(node, new QNameHolder());
   
           if (name != null) {
               return name;
  @@ -3758,4 +3776,12 @@
   
           return messageEntries;
       }
  +
  +    public boolean shouldUnwrapArrays() {
  +        return unwrapArrays;
  +    }
  +
  +    public void setUnwrapArrays(boolean unwrapArrays) {
  +        this.unwrapArrays = unwrapArrays;
  +    }
   }    // class SymbolTable
  
  
  
  1.17.2.1  +13 -0     ws-axis/java/src/org/apache/axis/wsdl/symbolTable/TypeEntry.java
  
  Index: TypeEntry.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/wsdl/symbolTable/TypeEntry.java,v
  retrieving revision 1.17
  retrieving revision 1.17.2.1
  diff -u -r1.17 -r1.17.2.1
  --- TypeEntry.java	18 Nov 2004 15:26:16 -0000	1.17
  +++ TypeEntry.java	12 Apr 2005 12:28:31 -0000	1.17.2.1
  @@ -85,6 +85,11 @@
   
       protected QName componentType = null;              // If this is an array, the component type
   
  +    /** If this TypeEntry represents an array with elements inside a "wrapper"
  +     * this field can optionally change the inner QName (default is <item>).
  +     */
  +    protected QName componentQName = null;
  +
       /** Field undefined */
       protected boolean undefined;                       // If refType is an Undefined type
   
  @@ -393,6 +398,14 @@
           this.componentType = componentType;
       }
   
  +    public QName getComponentQName() {
  +        return componentQName;
  +    }
  +
  +    public void setComponentQName(QName componentQName) {
  +        this.componentQName = componentQName;
  +    }
  +
       /**
        * Get string representation.
        * 
  
  
  
  No                   revision
  No                   revision
  1.85.2.1  +6 -4      ws-axis/java/src/org/apache/axis/wsdl/toJava/Emitter.java
  
  Index: Emitter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/wsdl/toJava/Emitter.java,v
  retrieving revision 1.85
  retrieving revision 1.85.2.1
  diff -u -r1.85 -r1.85.2.1
  --- Emitter.java	21 Mar 2005 12:37:20 -0000	1.85
  +++ Emitter.java	12 Apr 2005 12:28:31 -0000	1.85.2.1
  @@ -35,7 +35,6 @@
   import javax.xml.namespace.QName;
   import javax.xml.parsers.ParserConfigurationException;
   
  -import java.io.File;
   import java.io.FileInputStream;
   import java.io.IOException;
   import java.lang.reflect.Constructor;
  @@ -151,7 +150,7 @@
       private ServiceDesc serviceDesc;
   	
   	/** The deploy mode flag */
  -    private boolean isDeploy;	
  +    private boolean isDeploy;
   
       /**
        * Default constructor.
  @@ -1071,13 +1070,16 @@
        * @return true if exists, false if not
        */
       protected boolean doesExist(String className) {        
  -        Class cls = null;
           try {
  -            cls = ClassUtils.forName(className);            
  +            ClassUtils.forName(className);
           } catch (ClassNotFoundException e) {
               return false;
           }		
           
           return true;
       }
  +
  +    public void setUnwrapArrays(boolean unwrapArrays) {
  +        this.unwrapArrays = unwrapArrays;
  +    }
   }
  
  
  
  1.50.2.1  +6 -0      ws-axis/java/src/org/apache/axis/wsdl/toJava/JavaBeanHelperWriter.java
  
  Index: JavaBeanHelperWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/wsdl/toJava/JavaBeanHelperWriter.java,v
  retrieving revision 1.50
  retrieving revision 1.50.2.1
  diff -u -r1.50 -r1.50.2.1
  --- JavaBeanHelperWriter.java	20 Mar 2005 18:58:49 -0000	1.50
  +++ JavaBeanHelperWriter.java	12 Apr 2005 12:28:31 -0000	1.50.2.1
  @@ -373,6 +373,12 @@
                           pw.println("        elemField.setNillable(false);");
                       }
   
  +                    QName componentQName = elem.getType().getComponentQName();
  +                    if (componentQName != null) {
  +                        pw.println("        elemField.setItemQName(" +
  +                                   Utils.getNewQName(componentQName) + ");");
  +                    }
  +
                       pw.println("        typeDesc.addFieldDesc(elemField);");
                   }
               }
  
  
  
  1.144.2.1 +20 -4     ws-axis/java/src/org/apache/axis/wsdl/toJava/JavaStubWriter.java
  
  Index: JavaStubWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/wsdl/toJava/JavaStubWriter.java,v
  retrieving revision 1.144
  retrieving revision 1.144.2.1
  diff -u -r1.144 -r1.144.2.1
  --- JavaStubWriter.java	14 Feb 2005 04:05:42 -0000	1.144
  +++ JavaStubWriter.java	12 Apr 2005 12:28:31 -0000	1.144.2.1
  @@ -30,6 +30,7 @@
   import org.apache.axis.wsdl.symbolTable.SchemaUtils;
   import org.apache.axis.wsdl.symbolTable.SymbolTable;
   import org.apache.axis.wsdl.symbolTable.TypeEntry;
  +import org.apache.axis.wsdl.symbolTable.DefinedElement;
   import org.apache.commons.logging.Log;
   
   import javax.wsdl.Binding;
  @@ -542,6 +543,8 @@
                           + "(){");
                   pw.println(
                           "        org.apache.axis.description.OperationDesc oper;");
  +                pw.println(
  +                        "        org.apache.axis.description.ParameterDesc param;");
               }
   
               BindingOperation operation = (BindingOperation) operations.get(i);
  @@ -618,10 +621,23 @@
                   boolean isInHeader = p.isInHeader();
                   boolean isOutHeader = p.isOutHeader();
   
  -                pw.println("        oper.addParameter(" + paramNameText + ", "
  -                        + paramTypeText + ", " + javaType
  -                        + modeStrings[p.getMode()] + ", " + isInHeader
  -                        + ", " + isOutHeader + ");");
  +                pw.println("        param = new org.apache.axis.description.ParameterDesc(" +
  +                           paramNameText + ", " +
  +                           modeStrings[p.getMode()] + ", " +
  +                           paramTypeText + ", " +
  +                           javaType +
  +                           isInHeader + ", " + isOutHeader + ");");
  +                TypeEntry te = p.getType();
  +                if (te instanceof DefinedElement) {
  +                    te = te.getRefType();
  +                }
  +                QName componentQName = te.getComponentQName();
  +                if (componentQName != null) {
  +                    pw.println("        param.setItemQName(" +
  +                               Utils.getNewQName(componentQName) + ");");
  +                }
  +
  +                pw.println("        oper.addParameter(param);");
               }
   
               // set output type
  
  
  
  No                   revision
  No                   revision
  1.19.2.1  +20 -1     ws-axis/java/test/message/TestMessageElement.java
  
  Index: TestMessageElement.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/test/message/TestMessageElement.java,v
  retrieving revision 1.19
  retrieving revision 1.19.2.1
  diff -u -r1.19 -r1.19.2.1
  --- TestMessageElement.java	18 Feb 2005 13:03:58 -0000	1.19
  +++ TestMessageElement.java	12 Apr 2005 12:28:31 -0000	1.19.2.1
  @@ -306,11 +306,30 @@
           this.assertXMLEqual(xmlIn,xmlOut);
       }
   
  +    public void testElementConstructorUsingNamespaces() throws Exception {
  +        String xmlIn = "<ns1:document xmlns:ns1=\"urn:someURI\">\n" +
  +                       "  <ns2:child-element xmlns:ns2=\"urn:someOtherURI\">\n" +
  +                       "    some text nodes insides\n" +
  +                       "  </ns2:child-element>\n" +
  +                       "</ns1:document>";
  +
  +        Document doc = XMLUtils.newDocument(new ByteArrayInputStream(xmlIn.getBytes()));
  +        MessageElement me = new MessageElement(doc.getDocumentElement());
  +        String xmlOut = me.getAsString();
  +        System.out.println(xmlOut);
  +        // check that the String version of the XML are the same :
  +        // I ensure that the namespaces declaration have not been moved
  +        // this is needed when some elements are signed :
  +        // we sign an element (get a Hashcode)
  +        // if the serialization change that element, the Hashcode will
  +        // change and the signature check will fail.
  +        this.assertEquals(xmlIn, xmlOut);
  +    }
       /**
        * Test setting the text value on a MessageElement in various ways.
        *
        * @throws Exception on error
  -     */ 
  +     */
       public void testSetValue() throws Exception
       {
           MessageElement me;
  
  
  
  No                   revision
  No                   revision
  1.1.2.1   +7 -28     ws-axis/java/test/wsdl/arrays3/AddrBookServiceImplServiceTestCase.java
  
  Index: AddrBookServiceImplServiceTestCase.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/test/wsdl/arrays3/AddrBookServiceImplServiceTestCase.java,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- AddrBookServiceImplServiceTestCase.java	23 Mar 2005 02:24:29 -0000	1.1
  +++ AddrBookServiceImplServiceTestCase.java	12 Apr 2005 12:28:32 -0000	1.1.2.1
  @@ -59,9 +59,7 @@
           addr.setStreetNum(1);
           addr.setZip(47907);
           addr.setPhoneNumber(ph1);
  -        test.wsdl.arrays3.testclient.ArrayOfPhone arrph = new test.wsdl.arrays3.testclient.ArrayOfPhone();
  -        arrph.setItem(new test.wsdl.arrays3.testclient.Phone[] { ph2, ph3});
  -        addr.setOtherPhones(arrph);
  +        addr.setOtherPhones(new test.wsdl.arrays3.testclient.Phone[] { ph2, ph3});
   
           test.wsdl.arrays3.testclient.Address[] addrs = null;
   
  @@ -101,18 +99,13 @@
           assertEquals("retAddrs.length should be 1", 1, retAddrs.length);
           assertTrue("addr does not match", compareAddress(addr, retAddrs[0]));
           assertNull("retAddrs[0].getOtherPhones() should be null", retAddrs[0].getOtherPhones());
  -       
  -        test.wsdl.arrays3.testclient.ArrayOfPhone arrph1 = new test.wsdl.arrays3.testclient.ArrayOfPhone();
  -        arrph1.setItem(new test.wsdl.arrays3.testclient.Phone[] { });
  -        addr.setOtherPhones(arrph1);
  +        test.wsdl.arrays3.testclient.Phone[] arrph = new test.wsdl.arrays3.testclient.Phone[] { };
  +        addr.setOtherPhones(arrph);
           retAddrs = binding.echoAddresses(new test.wsdl.arrays3.testclient.Address[] { addr });
           assertEquals("retAddrs.length should be 1", 1, retAddrs.length);
   
  -        // length-0 array echoes as null now. 
  -        // So don't check object equality but check that value is null.
  -        
  -        // assertTrue("addr does not match", compareAddress(addr, retAddrs[0]));
  -        assertNull("retAddrs[0].getOtherPhones() should be null", retAddrs[0].getOtherPhones());
  +        assertTrue("addr does not match", compareAddress(addr, retAddrs[0]));
  +        //assertNull("retAddrs[0].getOtherPhones() should be null", retAddrs[0].getOtherPhones());
   
           addr.setOtherPhones(arrph);
           retAddrs = binding.echoAddresses(new test.wsdl.arrays3.testclient.Address[] { addr });
  @@ -166,28 +159,14 @@
               throw new AssertionFailedError("");
           }
   
  -        if (!compareArrayOfPhone(addr1.getOtherPhones(), addr2.getOtherPhones())) {
  +        if (!comparePhoneArray(addr1.getOtherPhones(), addr2.getOtherPhones())) {
               throw new AssertionFailedError("");
           }
   
           return true;
       }
   
  -    public boolean compareArrayOfPhone(test.wsdl.arrays3.testclient.ArrayOfPhone aop1, 
  -            test.wsdl.arrays3.testclient.ArrayOfPhone aop2) {
  -        if (aop1 == null && aop2 != null) {
  -            throw new AssertionFailedError("");
  -        }
  -        if (aop1 != null && aop2 == null) {
  -            throw new AssertionFailedError("");
  -        }
  -        if (aop1 == null && aop2 == null) {
  -            return true;
  -        }
  -        return comparePhoneArray(aop1.getItem(), aop2.getItem()); 
  -    }
  -
  -    public boolean comparePhoneArray(test.wsdl.arrays3.testclient.Phone[] arr1, 
  +    public boolean comparePhoneArray(test.wsdl.arrays3.testclient.Phone[] arr1,
               test.wsdl.arrays3.testclient.Phone[] arr2) {
           if (arr1 == null && arr2 != null) {
               throw new AssertionFailedError("");
  
  
  
  No                   revision
  No                   revision
  1.13.2.1  +2 -1      ws-axis/java/test/wsdl/clash/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/test/wsdl/clash/build.xml,v
  retrieving revision 1.13
  retrieving revision 1.13.2.1
  diff -u -r1.13 -r1.13.2.1
  --- build.xml	3 Feb 2005 17:33:04 -0000	1.13
  +++ build.xml	12 Apr 2005 12:28:32 -0000	1.13.2.1
  @@ -62,7 +62,8 @@
       </wsdl2java>
   
       <wsdl2java url="${axis.home}/test/wsdl/clash/duplicate-element.wsdl"
  -               output="${axis.home}/build/work">
  +               output="${axis.home}/build/work"
  +               unwrapArrays="no">
       </wsdl2java>
   
       <copy todir="${build.dir}/work/test/wsdl/clash" overwrite="yes">
  
  
  
  No                   revision
  No                   revision
  1.5.4.1   +1 -1      ws-axis/java/test/wsdl/interop4/groupH/simpleDocLit/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/test/wsdl/interop4/groupH/simpleDocLit/build.xml,v
  retrieving revision 1.5
  retrieving revision 1.5.4.1
  diff -u -r1.5 -r1.5.4.1
  --- build.xml	2 Jun 2004 17:05:20 -0000	1.5
  +++ build.xml	12 Apr 2005 12:28:32 -0000	1.5.4.1
  @@ -54,7 +54,7 @@
           <!-- generate skeletons -->
           <wsdl2java url="${axis.home}/test/wsdl/interop4/groupH/simpleDocLit/simple-doc-literal.wsdl"
               output="${root.dir}/build/work" skeletonDeploy="no"
  -            serverSide="yes">
  +            serverSide="yes" unwrapArrays="no">
               <mapping namespace="http://soapinterop.org/wsdl" package="test.wsdl.interop4.groupH.simpleDocLit"/>
               <mapping namespace="http://soapinterop.org/types" package="test.wsdl.interop4.groupH.simpleDocLit"/>
               <mapping namespace="http://soapinterop.org/types/part" package="test.wsdl.interop4.groupH.simpleDocLit"/>
  
  
  
  No                   revision
  No                   revision
  1.1.2.1   +2 -1      ws-axis/java/test/wsdl/marshall2/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/test/wsdl/marshall2/build.xml,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- build.xml	14 Feb 2005 18:20:44 -0000	1.1
  +++ build.xml	12 Apr 2005 12:28:32 -0000	1.1.2.1
  @@ -58,7 +58,8 @@
                  deployscope="session"
                  serverSide="yes"
                  typeMappingVersion="1.3"
  -               testcase="yes">
  +               testcase="yes"
  +               unwrapArrays="no">
       </wsdl2java>
   
       <copy todir="${build.dir}/work/test/wsdl/marshall2" overwrite="yes">
  
  
  
  No                   revision
  No                   revision
  1.1.2.1   +2 -1      ws-axis/java/test/wsdl/qnameser/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/test/wsdl/qnameser/build.xml,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- build.xml	16 Nov 2004 05:18:29 -0000	1.1
  +++ build.xml	12 Apr 2005 12:28:32 -0000	1.1.2.1
  @@ -58,7 +58,8 @@
                  serverSide="no"
                  skeletonDeploy="yes"
                  noWrapped="true"
  -               testcase="no">
  +               testcase="no"
  +               unwrapArrays="no">
           <mapping namespace="http://tempuri.org/" package="test.wsdl.qnameser"/>
       </wsdl2java>
   
  
  
  
  No                   revision
  No                   revision
  1.10.2.1  +2 -1      ws-axis/java/test/wsdl/roundtrip/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/test/wsdl/roundtrip/build.xml,v
  retrieving revision 1.10
  retrieving revision 1.10.2.1
  diff -u -r1.10 -r1.10.2.1
  --- build.xml	15 Jan 2005 13:33:41 -0000	1.10
  +++ build.xml	12 Apr 2005 12:28:32 -0000	1.10.2.1
  @@ -130,7 +130,8 @@
                  skeletonDeploy="yes"
                  noimports="no"
                  verbose="no"
  -               testcase="no">
  +               testcase="no"
  +               unwrapArrays="no">
           <mapping namespace="http://roundtrip.wsdl.test" package="test.wsdl.roundtrip"/>
       </wsdl2java>
   
  
  
  
  No                   revision
  No                   revision
  1.28.2.1  +14 -0     ws-axis/java/tools/org/apache/axis/tools/ant/wsdl/Wsdl2javaAntTask.java
  
  Index: Wsdl2javaAntTask.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/tools/org/apache/axis/tools/ant/wsdl/Wsdl2javaAntTask.java,v
  retrieving revision 1.28
  retrieving revision 1.28.2.1
  diff -u -r1.28 -r1.28.2.1
  --- Wsdl2javaAntTask.java	8 Feb 2005 18:44:38 -0000	1.28
  +++ Wsdl2javaAntTask.java	12 Apr 2005 12:28:32 -0000	1.28.2.1
  @@ -118,6 +118,8 @@
        */
       private boolean failOnNetworkErrors = false;
   
  +    private boolean unwrapArrays = true;
  +
       public Wsdl2javaAntTask() {
       }
   
  @@ -243,6 +245,7 @@
               emitter.setTypeMappingVersion(typeMappingVersion);
               emitter.setNowrap(noWrapped);
               emitter.setAllowInvalidURL(allowInvalidURL);
  +            emitter.setUnwrapArrays(unwrapArrays);
               if (namespaceMappingFile != null) {
                   emitter.setNStoPkg(namespaceMappingFile.toString());
               }
  @@ -557,6 +560,17 @@
   
   
       /**
  +     * Set the unwrap arrays flag - if false this will make new classes
  +     * like "ArrayOfString" for literal "wrapped" arrays.  Otherwise it
  +     * will use "String []" and generate appropriate metadata.
  +     *
  +     * @param unwrapArrays
  +     */
  +    public void setUnwrapArrays(boolean unwrapArrays) {
  +        this.unwrapArrays = unwrapArrays;
  +    }
  +
  +    /**
        * set the classpath
        * @return
        */