axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dee...@apache.org
Subject svn commit: r551859 - in /webservices/axis2/trunk/java/modules: integration/test-resources/ComplexDataTypes/ kernel/src/org/apache/axis2/description/java2wsdl/
Date Fri, 29 Jun 2007 11:56:12 GMT
Author: deepal
Date: Fri Jun 29 04:56:11 2007
New Revision: 551859

URL: http://svn.apache.org/viewvc?view=rev&rev=551859
Log:
fixing AXIS2-2792
 - Now we do not generate duplicate messages for the same exception type

Modified:
    webservices/axis2/trunk/java/modules/integration/test-resources/ComplexDataTypes/ComplexDataTypes.wsdl
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DocLitBareSchemaGenerator.java

Modified: webservices/axis2/trunk/java/modules/integration/test-resources/ComplexDataTypes/ComplexDataTypes.wsdl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/test-resources/ComplexDataTypes/ComplexDataTypes.wsdl?view=diff&rev=551859&r1=551858&r2=551859
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test-resources/ComplexDataTypes/ComplexDataTypes.wsdl
(original)
+++ webservices/axis2/trunk/java/modules/integration/test-resources/ComplexDataTypes/ComplexDataTypes.wsdl
Fri Jun 29 04:56:11 2007
@@ -16,56 +16,48 @@
                    elementFormDefault="qualified"
                    targetNamespace="http://arrays.data.complex.tempuri.org/xsd">
             <xs:import namespace="http://data.complex.tempuri.org/xsd"/>
-            <xs:element name="ArrayOfshort" type="ax22:ArrayOfshort"/>
             <xs:complexType name="ArrayOfshort">
                 <xs:sequence>
                     <xs:element maxOccurs="unbounded" minOccurs="0" name="_short" nillable="true"
                                 type="xs:short"/>
                 </xs:sequence>
             </xs:complexType>
-            <xs:element name="ArrayOfPerson" type="ax22:ArrayOfPerson"/>
             <xs:complexType name="ArrayOfPerson">
                 <xs:sequence>
                     <xs:element maxOccurs="unbounded" minOccurs="0" name="person" nillable="true"
                                 type="ax24:Person"/>
                 </xs:sequence>
             </xs:complexType>
-            <xs:element name="ArrayOfArrayOfstring" type="ax22:ArrayOfArrayOfstring"/>
             <xs:complexType name="ArrayOfArrayOfstring">
                 <xs:sequence>
                     <xs:element maxOccurs="unbounded" minOccurs="0" name="arrayOfstring"
                                 nillable="true" type="ax22:ArrayOfstring"/>
                 </xs:sequence>
             </xs:complexType>
-            <xs:element name="ArrayOfstring" type="ax22:ArrayOfstring"/>
             <xs:complexType name="ArrayOfstring">
                 <xs:sequence>
                     <xs:element maxOccurs="unbounded" minOccurs="0" name="string" nillable="true"
                                 type="xs:string"/>
                 </xs:sequence>
             </xs:complexType>
-            <xs:element name="ArrayOfNullableOfdateTime" type="ax22:ArrayOfNullableOfdateTime"/>
             <xs:complexType name="ArrayOfNullableOfdateTime">
                 <xs:sequence>
                     <xs:element maxOccurs="unbounded" minOccurs="0" name="dateTime" nillable="true"
                                 type="xs:dateTime"/>
                 </xs:sequence>
             </xs:complexType>
-            <xs:element name="ArrayOfNullableOfdecimal" type="ax22:ArrayOfNullableOfdecimal"/>
             <xs:complexType name="ArrayOfNullableOfdecimal">
                 <xs:sequence>
                     <xs:element maxOccurs="unbounded" minOccurs="0" name="decimal" nillable="true"
                                 type="xs:decimal"/>
                 </xs:sequence>
             </xs:complexType>
-            <xs:element name="ArrayOfanyType" type="ax22:ArrayOfanyType"/>
             <xs:complexType name="ArrayOfanyType">
                 <xs:sequence>
                     <xs:element maxOccurs="unbounded" minOccurs="0" name="anyType" nillable="true"
                                 type="xs:anyType"/>
                 </xs:sequence>
             </xs:complexType>
-            <xs:element name="ArrayOfint" type="ax22:ArrayOfint"/>
             <xs:complexType name="ArrayOfint">
                 <xs:sequence>
                     <xs:element maxOccurs="unbounded" minOccurs="0" name="_int" nillable="true"
@@ -78,7 +70,6 @@
                    elementFormDefault="qualified"
                    targetNamespace="http://data.complex.tempuri.org/xsd">
             <xs:import namespace="http://arrays.data.complex.tempuri.org/xsd"/>
-            <xs:element name="BitMask" type="ax21:BitMask"/>
             <xs:complexType name="BitMask">
                 <xs:sequence>
                     <xs:element minOccurs="0" name="BIT_FIVE" nillable="true" type="ax21:BitMask"/>
@@ -88,7 +79,6 @@
                     <xs:element minOccurs="0" name="BIT_TWO" nillable="true" type="ax21:BitMask"/>
                 </xs:sequence>
             </xs:complexType>
-            <xs:element name="Employee" type="ax21:Employee"/>
             <xs:complexType name="Employee">
                 <xs:sequence>
                     <xs:element minOccurs="0" name="baseDetails" nillable="true"
@@ -99,7 +89,6 @@
                                 type="ax23:ArrayOfshort"/>
                 </xs:sequence>
             </xs:complexType>
-            <xs:element name="Person" type="ax21:Person"/>
             <xs:complexType name="Person">
                 <xs:sequence>
                     <xs:element minOccurs="0" name="age" nillable="true" type="xs:double"/>
@@ -108,14 +97,12 @@
                     <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
                 </xs:sequence>
             </xs:complexType>
-            <xs:element name="Furniture" type="ax21:Furniture"/>
             <xs:complexType name="Furniture">
                 <xs:sequence>
                     <xs:element minOccurs="0" name="color" nillable="true" type="xs:string"/>
                     <xs:element minOccurs="0" name="price" nillable="true" type="xs:float"/>
                 </xs:sequence>
             </xs:complexType>
-            <xs:element name="Group" type="ax21:Group"/>
             <xs:complexType name="Group">
                 <xs:sequence>
                     <xs:element minOccurs="0" name="members" nillable="true"
@@ -123,13 +110,11 @@
                     <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
                 </xs:sequence>
             </xs:complexType>
-            <xs:element name="Name" type="ax21:Name"/>
             <xs:complexType name="Name">
                 <xs:sequence>
                     <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
                 </xs:sequence>
             </xs:complexType>
-            <xs:element name="Table" type="ax21:Table"/>
             <xs:complexType name="Table">
                 <xs:complexContent>
                     <xs:extension base="ax21:Furniture">

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?view=diff&rev=551859&r1=551858&r2=551859
==============================================================================
--- 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
Fri Jun 29 04:56:11 2007
@@ -86,6 +86,9 @@
     protected Class serviceClass = null;
     protected AxisService service;
 
+    //To check whether we need to generate Schema element for Exception
+    protected boolean generateBaseException ;
+
     public NamespaceGenerator getNsGen() throws Exception {
         if (nsGen == null) {
             nsGen = new DefaultNamespaceGenerator();
@@ -235,20 +238,37 @@
                     if (AxisFault.class.getName().equals(extype.getQualifiedName())) {
                         continue;
                     }
-                    String partQname = extype.getSimpleName() + "Fault";
+                    if (!generateBaseException) {
+                        methodSchemaType = createSchemaTypeForMethodPart("Exception");
+                        sequence = new XmlSchemaSequence();
+                        QName schemaTypeName = typeTable.getSimpleSchemaTypeName(Exception.class.getName());
+                        addContentToMethodSchemaType(sequence,
+                                schemaTypeName,
+                                "Exception",
+                                false);
+                        methodSchemaType.setParticle(sequence);
+                        generateBaseException = true;
+                    }
+                    String partQname = extype.getSimpleName();
                     methodSchemaType = createSchemaTypeForMethodPart(partQname);
                     sequence = new XmlSchemaSequence();
-                    generateSchemaForType(sequence, extype, extype.getSimpleName());
-                    methodSchemaType.setParticle(sequence);
+                    if (Exception.class.getName().equals(extype.getQualifiedName())) {
+                        addContentToMethodSchemaType(sequence,
+                                typeTable.getComplexSchemaType("Exception"),
+                                partQname,
+                                false);
+                        methodSchemaType.setParticle(sequence);
+                        typeTable.addComplexSchema(Exception.class.getPackage().getName(),
+                                methodSchemaType.getQName());
+                    } else {
+                        generateSchemaForType(sequence, extype, extype.getSimpleName());
+                        methodSchemaType.setParticle(sequence);
+                    }
                     if (AxisFault.class.getName().equals(extype.getQualifiedName())) {
                         continue;
                     }
                     AxisMessage faultMessage = new AxisMessage();
-                    if (extypes.length > 1) {
-                        faultMessage.setName(methodName + "Fault" + j);
-                    } else {
-                        faultMessage.setName(methodName + "Fault");
-                    }
+                    faultMessage.setName(extype.getSimpleName());
                     faultMessage.setElementQName(typeTable.getQNamefortheType(partQname));
                     axisOperation.setFaultMessages(faultMessage);
                 }
@@ -419,7 +439,7 @@
 
             complexType.setName(simpleName);
 
-            xmlSchema.getItems().add(eltOuter);
+//            xmlSchema.getItems().add(eltOuter);
             xmlSchema.getElements().add(schemaTypeName, eltOuter);
             eltOuter.setSchemaTypeName(complexType.getQName());
 
@@ -494,7 +514,6 @@
 
             for (int i = 0; i < froperties.length; i++) {
                 JField field = froperties[i];
-                String propertyName = field.getType().getQualifiedName();
                 boolean isArryType = field.getType().isArrayType();
 
                 this.generateSchemaforFieldsandProperties(xmlSchema, sequence, field.getType(),

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DocLitBareSchemaGenerator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DocLitBareSchemaGenerator.java?view=diff&rev=551859&r1=551858&r2=551859
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DocLitBareSchemaGenerator.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DocLitBareSchemaGenerator.java
Fri Jun 29 04:56:11 2007
@@ -99,20 +99,37 @@
                     if (AxisFault.class.getName().equals(extype.getQualifiedName())) {
                         continue;
                     }
-                    String partQname = extype.getSimpleName() + "Fault";
+                     if (!generateBaseException) {
+                        methodSchemaType = createSchemaTypeForMethodPart("Exception");
+                        sequence = new XmlSchemaSequence();
+                        QName schemaTypeName = typeTable.getSimpleSchemaTypeName(Exception.class.getName());
+                        addContentToMethodSchemaType(sequence,
+                                schemaTypeName,
+                                "Exception",
+                                false);
+                        methodSchemaType.setParticle(sequence);
+                        generateBaseException = true;
+                    }
+                    String partQname = extype.getSimpleName();
                     methodSchemaType = createSchemaTypeForMethodPart(partQname);
                     sequence = new XmlSchemaSequence();
-                    generateSchemaForType(sequence, extype, extype.getSimpleName());
-                    methodSchemaType.setParticle(sequence);
+                    if (Exception.class.getName().equals(extype.getQualifiedName())) {
+                        addContentToMethodSchemaType(sequence,
+                                typeTable.getComplexSchemaType("Exception"),
+                                partQname,
+                                false);
+                        methodSchemaType.setParticle(sequence);
+                        typeTable.addComplexSchema(Exception.class.getPackage().getName(),
+                                methodSchemaType.getQName());
+                    } else {
+                        generateSchemaForType(sequence, extype, extype.getSimpleName());
+                        methodSchemaType.setParticle(sequence);
+                    }
                     if (AxisFault.class.getName().equals(extype.getQualifiedName())) {
                         continue;
                     }
                     AxisMessage faultMessage = new AxisMessage();
-                    if (extypes.length > 1) {
-                        faultMessage.setName(methodName + "Fault" + j);
-                    } else {
-                        faultMessage.setName(methodName + "Fault");
-                    }
+                    faultMessage.setName(extype.getSimpleName());
                     faultMessage.setElementQName(typeTable.getQNamefortheType(partQname));
                     axisOperation.setFaultMessages(faultMessage);
                 }
@@ -397,7 +414,7 @@
 
             complexType.setName(simpleName);
 
-            xmlSchema.getItems().add(eltOuter);
+//            xmlSchema.getItems().add(eltOuter);
             xmlSchema.getElements().add(schemaTypeName, eltOuter);
             eltOuter.setSchemaTypeName(complexType.getQName());
 



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message