cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r467902 - in /incubator/cxf/trunk: systests/src/test/java/org/apache/cxf/systest/jaxws/ testutils/src/main/java/org/apache/cxf/anonymous_complex_type/ testutils/src/main/resources/wsdl/
Date Thu, 26 Oct 2006 07:53:21 GMT
Author: ffang
Date: Thu Oct 26 00:53:20 2006
New Revision: 467902

URL: http://svn.apache.org/viewvc?view=rev&rev=467902
Log:
[CXF-176] add test for anonymous ref in wsdl schema defination

Modified:
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/HeaderClientServerTest.java
    incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/anonymous_complex_type/AnonymousComplexTypeImpl.java
    incubator/cxf/trunk/testutils/src/main/resources/wsdl/anonymous_complex_type.wsdl

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java?view=diff&rev=467902&r1=467901&r2=467902
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
(original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
Thu Oct 26 00:53:20 2006
@@ -30,6 +30,8 @@
 import org.apache.cxf.anonymous_complex_type.AnonymousComplexType;
 import org.apache.cxf.anonymous_complex_type.AnonymousComplexTypeImpl;
 import org.apache.cxf.anonymous_complex_type.AnonymousComplexTypeService;
+import org.apache.cxf.anonymous_complex_type.SplitName;
+import org.apache.cxf.anonymous_complex_type.SplitNameResponse;
 import org.apache.cxf.anonymous_complex_type.SplitNameResponse.Names;
 import org.apache.cxf.systest.common.ClientServerSetupBase;
 import org.apache.cxf.systest.common.ClientServerTestBase;
@@ -86,4 +88,21 @@
         }
     }
 
+    public void testRefAnonymousComplexType() throws Exception {
+
+        AnonymousComplexTypeService actService = new AnonymousComplexTypeService();
+        assertNotNull(actService);
+        AnonymousComplexType act = actService.getPort(portName, AnonymousComplexType.class);
+        
+        try {
+            SplitName name = new SplitName();
+            name.setName("Tom Li");
+            SplitNameResponse reply = act.refSplitName(name);
+            assertNotNull("no response received from service", reply);
+            assertEquals("Tom", reply.getNames().getFirst());
+            assertEquals("Li", reply.getNames().getSecond());
+        } catch (UndeclaredThrowableException ex) {
+            throw (Exception) ex.getCause();
+        }
+    }
 }

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/HeaderClientServerTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/HeaderClientServerTest.java?view=diff&rev=467902&r1=467901&r2=467902
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/HeaderClientServerTest.java
(original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/HeaderClientServerTest.java
Thu Oct 26 00:53:20 2006
@@ -93,7 +93,7 @@
     
     
      
-    public void stestInHeader() throws Exception {
+    public void testInHeader() throws Exception {
         URL wsdl = getClass().getResource("/wsdl/soapheader.wsdl");
         assertNotNull(wsdl);
         
@@ -112,7 +112,7 @@
         }
     } 
 
-    public void stestOutHeader() throws Exception {
+    public void testOutHeader() throws Exception {
         URL wsdl = getClass().getResource("/wsdl/soapheader.wsdl");
         assertNotNull(wsdl);
         
@@ -138,7 +138,7 @@
         } 
     } 
 
-    public void stestInOutHeader() throws Exception {
+    public void testInOutHeader() throws Exception {
         URL wsdl = getClass().getResource("/wsdl/soapheader.wsdl");
         assertNotNull(wsdl);
         

Modified: incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/anonymous_complex_type/AnonymousComplexTypeImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/anonymous_complex_type/AnonymousComplexTypeImpl.java?view=diff&rev=467902&r1=467901&r2=467902
==============================================================================
--- incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/anonymous_complex_type/AnonymousComplexTypeImpl.java
(original)
+++ incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/anonymous_complex_type/AnonymousComplexTypeImpl.java
Thu Oct 26 00:53:20 2006
@@ -21,7 +21,8 @@
 
 import javax.jws.WebService;
 
-import org.apache.cxf.anonymous_complex_type.SplitNameResponse.Names;
+
+
 
 @WebService(serviceName = "anonymous_complex_type_service", 
         portName = "anonymous_complex_typeSOAP", 
@@ -30,10 +31,9 @@
         
 public class AnonymousComplexTypeImpl implements AnonymousComplexType {
 
-    public Names splitName(String name) {
-        // TODO Auto-generated method stub
+    public SplitNameResponse.Names splitName(String name) {
         if (name != null) {
-            Names names = new Names();
+            SplitNameResponse.Names names = new SplitNameResponse.Names();
             int pos = name.indexOf(" ");
             if (pos > 0) {
                 names.setFirst(name.substring(0, pos));
@@ -45,4 +45,28 @@
         }
         return null;
     }
+
+    public SplitNameResponse refSplitName(SplitName splitName) {
+        if (splitName.getName() != null) {
+            String name = splitName.getName();
+            SplitNameResponse.Names names = new SplitNameResponse.Names();
+            int pos = name.indexOf(" ");
+            SplitNameResponse response = null;
+            if (pos > 0) {
+                names.setFirst(name.substring(0, pos));
+                names.setSecond(name.substring(pos + 1));
+            } else {
+                names.setFirst(name);
+            
+                
+                
+            }
+            response = new SplitNameResponse();
+            response.setNames(names);
+            return response;
+        }
+        return null;
+    }
 }
+
+

Modified: incubator/cxf/trunk/testutils/src/main/resources/wsdl/anonymous_complex_type.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/testutils/src/main/resources/wsdl/anonymous_complex_type.wsdl?view=diff&rev=467902&r1=467901&r2=467902
==============================================================================
--- incubator/cxf/trunk/testutils/src/main/resources/wsdl/anonymous_complex_type.wsdl (original)
+++ incubator/cxf/trunk/testutils/src/main/resources/wsdl/anonymous_complex_type.wsdl Thu
Oct 26 00:53:20 2006
@@ -44,7 +44,25 @@
                     </xsd:sequence>
                 </xsd:complexType>
             </xsd:element>
+
+            <xsd:element name="RefSplitNameResponse">
+                <xsd:complexType>
+                    <xsd:sequence>
+                        <xsd:element ref="tns:SplitNameResponse" />
+                    </xsd:sequence>
+                </xsd:complexType> 
+            </xsd:element>
+            <xsd:element name="RefSplitName">
+                <xsd:complexType>
+                    <xsd:sequence>
+                        <xsd:element ref="tns:SplitName" />
+                    </xsd:sequence>
+                </xsd:complexType> 
+	    </xsd:element>
+
+
         </xsd:schema>
+
     </wsdl:types>
     <wsdl:message name="SplitNameResponse">
         <wsdl:part element="tns:SplitNameResponse" name="SplitNameResponse" />
@@ -52,15 +70,34 @@
     <wsdl:message name="SplitNameRequest">
         <wsdl:part element="tns:SplitName" name="SplitName" />
     </wsdl:message>
+    <wsdl:message name="RefSplitNameResponse">
+        <wsdl:part element="tns:RefSplitNameResponse" name="RefSplitNameResponse" />
+    </wsdl:message>
+    <wsdl:message name="RefSplitNameRequest">
+        <wsdl:part element="tns:RefSplitName" name="RefSplitName" />
+    </wsdl:message>
     <wsdl:portType name="anonymous_complex_type">
         <wsdl:operation name="SplitName">
             <wsdl:input message="tns:SplitNameRequest" />
             <wsdl:output message="tns:SplitNameResponse" />
         </wsdl:operation>
+        <wsdl:operation name="RefSplitName">
+            <wsdl:input message="tns:RefSplitNameRequest" />
+            <wsdl:output message="tns:RefSplitNameResponse" />
+        </wsdl:operation>
     </wsdl:portType>
     <wsdl:binding name="anonymous_complex_typeSOAP" type="tns:anonymous_complex_type">
         <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"
/>
         <wsdl:operation name="SplitName">
+            <soap:operation soapAction="http://cxf.apache.org/anonymous_complex_type/SplitName"
/>
+            <wsdl:input>
+                <soap:body use="literal" />
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal" />
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="RefSplitName">
             <soap:operation soapAction="http://cxf.apache.org/anonymous_complex_type/SplitName"
/>
             <wsdl:input>
                 <soap:body use="literal" />



Mime
View raw message