You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by aj...@apache.org on 2005/08/24 07:13:25 UTC

svn commit: r239533 - in /webservices/axis/trunk/java/modules/wsdl: src/org/apache/axis2/wsdl/codegen/extension/XMLBeansExtension.java test-resources/ping.wsdl test/org/apache/axis2/wsdl/codegen/WSDL2JavaTest.java

Author: ajith
Date: Tue Aug 23 22:12:59 2005
New Revision: 239533

URL: http://svn.apache.org/viewcvs?rev=239533&view=rev
Log:
Last night's change seems to be an incorrect way of handling schema's. Reverted some changes in the XMLBeans extension
The WSDL2Java test has been updated to include a new WSDL

Added:
    webservices/axis/trunk/java/modules/wsdl/test-resources/ping.wsdl
Modified:
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/extension/XMLBeansExtension.java
    webservices/axis/trunk/java/modules/wsdl/test/org/apache/axis2/wsdl/codegen/WSDL2JavaTest.java

Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/extension/XMLBeansExtension.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/extension/XMLBeansExtension.java?rev=239533&r1=239532&r2=239533&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/extension/XMLBeansExtension.java (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/extension/XMLBeansExtension.java Tue Aug 23 22:12:59 2005
@@ -57,7 +57,7 @@
             //get the types from the types section
             WSDLTypes typesList = configuration.getWom().getTypes();
 
-            //check for the imported types
+            //check for the imported types. Any imported types are supposed to be here also
             if (typesList == null) {
                 //there are no types to be code generated
                 //However if the type mapper is left empty it will be a problem for the other
@@ -69,9 +69,9 @@
             List typesArray = typesList.getExtensibilityElements();
             WSDLExtensibilityElement extensiblityElt;
             SchemaTypeSystem sts;
-            Vector schemabaseURIList=new Vector();
+            //Vector schemabaseURIList=new Vector();
             Vector xmlObjectsVector= new Vector();
-            String schemaBaseURI ;
+            //String schemaBaseURI ;
 
             //create the type mapper
             JavaTypeMapper mapper = new JavaTypeMapper();
@@ -90,15 +90,10 @@
                     //compile these schemas
                     while (!importedSchemaStack.isEmpty()){
                         javax.wsdl.extensions.schema.Schema tempSchema = (javax.wsdl.extensions.schema.Schema) importedSchemaStack.pop();
-                        schemaBaseURI = tempSchema.getDocumentBaseURI();
-                        //prevent the readdition of schama's that has already being added
-                        if (!schemabaseURIList.contains(schemaBaseURI)){
-                            schemabaseURIList.add(schemaBaseURI);
-                            xmlObjectsVector.add(
-                                    XmlObject.Factory.parse(
-                                            tempSchema.getElement()
-                                            ,options));
-                        }
+                        xmlObjectsVector.add(
+                                XmlObject.Factory.parse(
+                                        tempSchema.getElement()
+                                        ,options));
 
                     }
 

Added: webservices/axis/trunk/java/modules/wsdl/test-resources/ping.wsdl
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/test-resources/ping.wsdl?rev=239533&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/test-resources/ping.wsdl (added)
+++ webservices/axis/trunk/java/modules/wsdl/test-resources/ping.wsdl Tue Aug 23 22:12:59 2005
@@ -0,0 +1,99 @@
+<definitions xmlns:s1="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
+             xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
+             xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+             xmlns:s="http://www.w3.org/2001/XMLSchema"
+             xmlns:tns="http://xmlsoap.org/Ping"
+             xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
+             xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
+             xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
+             targetNamespace="http://xmlsoap.org/Ping"
+             xmlns="http://schemas.xmlsoap.org/wsdl/">
+    <types>
+        <s:schema elementFormDefault="qualified" targetNamespace="http://xmlsoap.org/Ping">
+            <s:import namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"/>
+            <s:element name="Ping" nillable="true" type="tns:ping"/>
+            <s:complexType name="ping">
+                <s:sequence>
+                    <s:element minOccurs="0" maxOccurs="1" name="ticket" type="tns:ticketType"/>
+                    <s:element minOccurs="1" maxOccurs="1" name="text" nillable="true" type="s:string"/>
+                </s:sequence>
+            </s:complexType>
+            <s:complexType name="ticketType">
+                <s:simpleContent>
+                    <s:extension base="s:string">
+                        <s:attribute ref="s1:Id"/>
+                    </s:extension>
+                </s:simpleContent>
+            </s:complexType>
+            <s:element name="PingResponse" nillable="true" type="tns:pingResponse"/>
+            <s:complexType name="pingResponse">
+                <s:sequence>
+                    <s:element minOccurs="1" maxOccurs="1" name="text" nillable="true" type="s:string"/>
+                </s:sequence>
+            </s:complexType>
+        </s:schema>
+        <s:schema elementFormDefault="qualified" targetNamespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
+            <s:attribute name="Id" type="s:string"/>
+        </s:schema>
+    </types>
+    <message name="PingRequest">
+        <part name="ping" element="tns:Ping"/>
+    </message>
+    <message name="PingResponse">
+        <part name="pingResponse" element="tns:PingResponse"/>
+    </message>
+    <portType name="PingPort">
+        <operation name="Ping">
+            <input message="tns:PingRequest"/>
+            <output message="tns:PingResponse"/>
+        </operation>
+    </portType>
+    <binding name="PingBinding" type="tns:PingPort">
+        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+        <operation name="Ping">
+            <soap:operation soapAction="Ping" style="document"/>
+            <input>
+                <soap:body use="literal"/>
+            </input>
+            <output>
+                <soap:body use="literal"/>
+            </output>
+        </operation>
+    </binding>
+    <service name="PingService">
+        <port name="Ping1" binding="tns:PingBinding">
+            <soap:address location="http://localhost:9080/pingservice/Ping1"/>
+        </port>
+        <port name="Ping2" binding="tns:PingBinding">
+            <soap:address location="http://localhost:9080/pingservice/Ping2"/>
+        </port>
+        <port name="Ping2a" binding="tns:PingBinding">
+            <soap:address location="http://localhost:9080/pingservice/Ping2a"/>
+        </port>
+        <port name="Ping3" binding="tns:PingBinding">
+            <soap:address location="http://localhost:9080/pingservice/Ping3"/>
+        </port>
+        <port name="Ping4" binding="tns:PingBinding">
+            <soap:address location="http://localhost:9080/pingservice/Ping4"/>
+        </port>
+        <port name="Ping5" binding="tns:PingBinding">
+            <soap:address location="http://localhost:9080/pingservice/Ping5"/>
+        </port>
+        <port name="Ping6" binding="tns:PingBinding">
+            <soap:address location="http://localhost:9080/pingservice/Ping6"/>
+        </port>
+        <port name="Ping7" binding="tns:PingBinding">
+            <soap:address location="http://localhost:9080/pingservice/Ping7"/>
+        </port>
+        <port name="STPing1" binding="tns:PingBinding">
+            <soap:address location="http://localhost:9080/pingservice/STPing1"/>
+        </port>
+        <port name="STPing3" binding="tns:PingBinding">
+            <soap:address location="http://localhost:9080/pingservice/STPing3"/>
+        </port>
+        <port name="STPing4" binding="tns:PingBinding">
+            <soap:address location="http://localhost:9080/pingservice/STPing4"/>
+        </port>
+        
+    </service>
+</definitions>

Modified: webservices/axis/trunk/java/modules/wsdl/test/org/apache/axis2/wsdl/codegen/WSDL2JavaTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/test/org/apache/axis2/wsdl/codegen/WSDL2JavaTest.java?rev=239533&r1=239532&r2=239533&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/test/org/apache/axis2/wsdl/codegen/WSDL2JavaTest.java (original)
+++ webservices/axis/trunk/java/modules/wsdl/test/org/apache/axis2/wsdl/codegen/WSDL2JavaTest.java Tue Aug 23 22:12:59 2005
@@ -70,18 +70,30 @@
         // The directory is now empty so delete it
         return dir.delete();
     }
-    /**
-     * Test for the WSAT wsdl
-     */
-    public void testCodeGenerationWSAT(){
+        /**
+         * Test for the WSAT wsdl
+         */
+        public void testCodeGenerationWSAT(){
 
-        try {
-            generateAndCompile("wsat.wsdl");
-        } catch (CodeGenerationException e) {
-            fail("Exception while codegeneration test!"+ e.getMessage());
+            try {
+                generateAndCompile("wsat.wsdl");
+            } catch (CodeGenerationException e) {
+                fail("Exception while codegeneration test!"+ e.getMessage());
+            }
         }
-    }
 
+
+    /**
+         * Test for the ping WSDL
+         */
+        public void testCodeGenerationPing(){
+
+            try {
+                generateAndCompile("ping.wsdl");
+            } catch (CodeGenerationException e) {
+                fail("Exception while codegeneration test!"+ e.getMessage());
+            }
+        }
 
     /**
      * Test for the interoptestdoclit.wsdl