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/31 12:23:02 UTC

svn commit: r265002 - in /webservices/axis2/trunk/java/modules/wsdl: test-resources/mtomecho.wsdl test/org/apache/axis2/wsdl/codegen/WSDL2JavaTest.java

Author: ajith
Date: Wed Aug 31 03:22:52 2005
New Revision: 265002

URL: http://svn.apache.org/viewcvs?rev=265002&view=rev
Log:
Updating the test case to test the Xmime schema addition

Added:
    webservices/axis2/trunk/java/modules/wsdl/test-resources/mtomecho.wsdl
Modified:
    webservices/axis2/trunk/java/modules/wsdl/test/org/apache/axis2/wsdl/codegen/WSDL2JavaTest.java

Added: webservices/axis2/trunk/java/modules/wsdl/test-resources/mtomecho.wsdl
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/wsdl/test-resources/mtomecho.wsdl?rev=265002&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/wsdl/test-resources/mtomecho.wsdl (added)
+++ webservices/axis2/trunk/java/modules/wsdl/test-resources/mtomecho.wsdl Wed Aug 31 03:22:52 2005
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="utf-8"?>
+<wsdl:definitions xmlns:x="http://example.org/mtom/data" 
+				  xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" 
+				  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
+				  xmlns:tns="http://martingudgin-2.dsl.easynet.co.uk/mtom"
+				  targetNamespace="http://martingudgin-2.dsl.easynet.co.uk/mtom" >
+
+  <wsdl:types>
+	<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' 
+			   xmlns:xmime='http://www.w3.org/2004/06/xmlmime'
+			   targetNamespace='http://example.org/mtom/data'>
+
+	  <xs:import namespace='http://www.w3.org/2004/06/xmlmime' />
+
+	  <xs:element name='Data' >
+		<xs:complexType>
+		  <xs:simpleContent>
+			<xs:extension base='xs:base64Binary' >
+			  <xs:attribute ref='xmime:contentType' />
+			</xs:extension>
+		  </xs:simpleContent>
+		</xs:complexType>
+	  </xs:element>
+
+	  <xs:element name='EchoTest' >
+		<xs:complexType>
+		  <xs:sequence>
+			<xs:element ref='x:Data' minOccurs='1' maxOccurs='unbounded' />
+		  </xs:sequence>
+		</xs:complexType>
+	  </xs:element>
+		
+	</xs:schema>
+  </wsdl:types>
+	
+  <wsdl:message name="EchoTestSingle">
+	<wsdl:part name="P" element="x:Data"/>
+  </wsdl:message>
+
+  <wsdl:message name="EchoTestMultiple">
+	<wsdl:part name="P" element="x:EchoTest"/>
+  </wsdl:message>
+	
+  <wsdl:portType name="EchoTest">
+	<wsdl:operation name="EchoTestSingle">
+	  <wsdl:input name="EchoTestSingleInput" message="tns:EchoTestSingle"/>
+	  <wsdl:output name="EchoTestSingleOutput" message="tns:EchoTestSingle"/>
+	</wsdl:operation>
+	<wsdl:operation name="EchoTestMultiple">
+	  <wsdl:input name="EchoTestMultipleInput" message="tns:EchoTestMultiple"/>
+	  <wsdl:output name="EchoTestMultipleOutput" message="tns:EchoTestMultiple"/>
+	</wsdl:operation>
+  </wsdl:portType>
+
+  <wsdl:binding name="EchoTest" type="tns:EchoTest">
+	<soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+	<wsdl:operation name="EchoTestSingle">
+	  <soap12:operation />
+	  <wsdl:input name="EchoTestSingleInput">
+		<soap12:body use="literal"/>
+	  </wsdl:input>
+	  <wsdl:output name="EchoTestSingleOutput">
+		<soap12:body use="literal"/>
+	  </wsdl:output>
+	</wsdl:operation>
+	<wsdl:operation name="EchoTestMultiple">
+	  <soap12:operation />
+	  <wsdl:input name="EchoTestMultipleInput">
+		<soap12:body use="literal"/>
+	  </wsdl:input>
+	  <wsdl:output name="EchoTestMultipleOutput">
+		<soap12:body use="literal"/>
+	  </wsdl:output>
+	</wsdl:operation>
+  </wsdl:binding>
+
+  <wsdl:service name="EchoTest">
+	<wsdl:port name="EchoTest" binding="tns:EchoTest">
+	  <soap12:address location="http://martingudgin-2.dsl.easynet.co.uk/dotnet/mtom/mtomecho.ashx" />
+	</wsdl:port>
+  </wsdl:service>
+
+</wsdl:definitions>	

Modified: webservices/axis2/trunk/java/modules/wsdl/test/org/apache/axis2/wsdl/codegen/WSDL2JavaTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/wsdl/test/org/apache/axis2/wsdl/codegen/WSDL2JavaTest.java?rev=265002&r1=265001&r2=265002&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/wsdl/test/org/apache/axis2/wsdl/codegen/WSDL2JavaTest.java (original)
+++ webservices/axis2/trunk/java/modules/wsdl/test/org/apache/axis2/wsdl/codegen/WSDL2JavaTest.java Wed Aug 31 03:22:52 2005
@@ -136,14 +136,27 @@
         }
     }
 
-     /**
-     * Test for the modified ping-unboond wsdl. The binding is removed
-     * statement
+    /**
+     * Test for the modified ping-unboond wsdl. The binding is removed in this wsdl
+     *
      */
     public void testCodeGenerationPingUnbound(){
 
         try {
             generateAndCompile("ping-unbound.wsdl", OUTPUT_LOCATION_BASE+OUTPUT_LOCATION_PREFIX+FOLDER_COUNT++);
+        } catch (CodeGenerationException e) {
+            fail("Exception while code generation test!"+ e.getMessage());
+        }
+    }
+
+    /**
+     * Test for the mtom echo wsdl. This wsdl contains a restriction based on xmime
+     *
+     */
+    public void testCodeGenerationMTOMEcho(){
+
+        try {
+            generateAndCompile("mtomecho.wsdl", OUTPUT_LOCATION_BASE+OUTPUT_LOCATION_PREFIX+FOLDER_COUNT++);
         } catch (CodeGenerationException e) {
             fail("Exception while code generation test!"+ e.getMessage());
         }