axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ami...@apache.org
Subject svn commit: r704460 - /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java
Date Tue, 14 Oct 2008 11:06:25 GMT
Author: amilas
Date: Tue Oct 14 04:06:25 2008
New Revision: 704460

URL: http://svn.apache.org/viewvc?rev=704460&view=rev
Log:
fixing the issue 4073. Added multi dimentional array support

Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java?rev=704460&r1=704459&r2=704460&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java
Tue Oct 14 04:06:25 2008
@@ -692,17 +692,40 @@
                             new QName(xmlSchema.getTargetNamespace(), simpleTypeName), xmlSchemaComplexType);
                 }
 
-                XmlSchemaElement elt1 = new XmlSchemaElement();
-                elt1.setName(partName);
-                elt1.setSchemaTypeName(new QName(xmlSchema.getTargetNamespace(), simpleTypeName));
-                sequence.getItems().add(elt1);
-                elt1.setMaxOccurs(Long.MAX_VALUE);
-                elt1.setMinOccurs(0);
+                if (isGenerateWrappedArrayTypes) {
+                    XmlSchemaElement xmlSchemaElement = new XmlSchemaElement();
+                    xmlSchemaElement.setName("arrayWrapper");
+                    xmlSchemaElement.setNillable(true);
+                    sequence.getItems().add(xmlSchemaElement);
 
-                if (!type.isPrimitive()) {
-                    elt1.setNillable(true);
+                    String complexTypeName = simpleTypeName + "Wrapper";
+
+                    XmlSchemaComplexType xmlSchemaComplexType = new XmlSchemaComplexType(xmlSchema);
+                    XmlSchemaSequence xmlSchemaSequence = new XmlSchemaSequence();
+                    xmlSchemaComplexType.setParticle(xmlSchemaSequence);
+                    xmlSchemaComplexType.setName(complexTypeName);
+
+                    xmlSchema.getItems().add(xmlSchemaComplexType);
+                    xmlSchema.getSchemaTypes().add(
+                            new QName(schemaTargetNameSpace, xmlSchemaComplexType.getName()),
+                            xmlSchemaComplexType);
+                    addContentToMethodSchemaType(xmlSchemaSequence,
+                            new QName(xmlSchema.getTargetNamespace(), simpleTypeName),
+                            "array",
+                            true);
+
+                    xmlSchemaElement.setSchemaType(xmlSchemaComplexType);
+                    xmlSchemaElement.setSchemaTypeName(new QName(schemaTargetNameSpace, xmlSchemaComplexType.getName()));
+                    return new QName(xmlSchema.getTargetNamespace(), complexTypeName);
+                } else {
+                    addContentToMethodSchemaType(sequence,
+                            new QName(xmlSchema.getTargetNamespace(), simpleTypeName),
+                            partName,
+                            true);
+                    return new QName(xmlSchema.getTargetNamespace(), simpleTypeName);
                 }
-                return new QName(xmlSchema.getTargetNamespace(), simpleTypeName);
+
+
             } else {
                 type = type.getComponentType();
             }
@@ -741,6 +764,7 @@
 
                 XmlSchemaElement xmlSchemaElement = new XmlSchemaElement();
                 xmlSchemaElement.setName("arrayWrapper");
+                xmlSchemaElement.setNillable(true);
                 sequence.getItems().add(xmlSchemaElement);
 
                 String complexTypeName = schemaTypeName.getLocalPart() + "Wrapper";
@@ -751,7 +775,7 @@
                     xmlSchemaComplexType = new XmlSchemaComplexType(xmlSchema);
                     XmlSchemaSequence xmlSchemaSequence = new XmlSchemaSequence();
                     xmlSchemaComplexType.setParticle(xmlSchemaSequence);
-                    xmlSchemaComplexType.setName(schemaTypeName.getLocalPart() + "Wrapper");
+                    xmlSchemaComplexType.setName(complexTypeName);
 
                     xmlSchema.getItems().add(xmlSchemaComplexType);
                     xmlSchema.getSchemaTypes().add(



Mime
View raw message