cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t..@apache.org
Subject svn commit: r442432 - in /incubator/cxf/trunk: rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ rt/bindings/xml/src/test/resources/ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ systests/src/test/java/org/apache/cxf/jaxws/
Date Tue, 12 Sep 2006 03:21:58 GMT
Author: tli
Date: Mon Sep 11 20:21:57 2006
New Revision: 442432

URL: http://svn.apache.org/viewvc?view=rev&rev=442432
Log:
Add RPC style systest, remove un-used xml test resource

Added:
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/jaxws/ClientServerRPCLitTest.java
  (with props)
Removed:
    incubator/cxf/trunk/rt/bindings/xml/src/test/resources/message-bare-single-param-type.xml
Modified:
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCInInterceptor.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCInInterceptor.java?view=diff&rev=442432&r1=442431&r2=442432
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCInInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCInInterceptor.java
Mon Sep 11 20:21:57 2006
@@ -72,6 +72,8 @@
             operation = getOperation(message, xmlReader);            
             // Store operation into the message.
             message.getExchange().put(BindingOperationInfo.class, operation);
+        } else {
+            operation = message.getExchange().get(BindingOperationInfo.class);
         }
         findMethod(message);
         MessageInfo msg;
@@ -109,7 +111,12 @@
     private void findMethod(Message message) {
         Endpoint ep = message.getExchange().get(Endpoint.class);
         BindingOperationInfo boi = message.getExchange().get(BindingOperationInfo.class);
-        Class implementorClass = ep.getImplementor().getClass();
+        Class implementorClass = null;
+        if (!isRequestor(message)) {
+            implementorClass = ep.getImplementor().getClass();
+        } else {
+            implementorClass = (Class)ep.getImplementor();
+        }
         for (Method meth : implementorClass.getDeclaredMethods()) {
             String opName = boi.getOperationInfo().getName().getLocalPart();
             if (ProcessorUtil.mangleNameToVariableName(meth.getName()).equals(opName)) {

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java?view=diff&rev=442432&r1=442431&r2=442432
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
Mon Sep 11 20:21:57 2006
@@ -204,6 +204,7 @@
         JaxwsEndpointImpl jaxwsEndpoint;
         try {
             jaxwsEndpoint = new JaxwsEndpointImpl(bus, service, ei);
+            jaxwsEndpoint.setImplementor(serviceEndpointInterface);
         } catch (EndpointException e) {
             throw new WebServiceException(e);
         }

Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/jaxws/ClientServerRPCLitTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/jaxws/ClientServerRPCLitTest.java?view=auto&rev=442432
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/jaxws/ClientServerRPCLitTest.java
(added)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/jaxws/ClientServerRPCLitTest.java
Mon Sep 11 20:21:57 2006
@@ -0,0 +1,96 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.jaxws;
+
+import java.lang.reflect.UndeclaredThrowableException;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Endpoint;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.apache.cxf.systest.common.ClientServerSetupBase;
+import org.apache.cxf.systest.common.TestServerBase;
+import org.apache.hello_world_rpclit.GreeterRPCLit;
+import org.apache.hello_world_rpclit.SOAPServiceRPCLit;
+import org.apache.hello_world_rpclit.types.MyComplexStruct;
+import org.apache.hello_world_soap_http.RPCLitGreeterImpl;
+
+
+public class ClientServerRPCLitTest extends TestCase {
+
+    private final QName portName = new QName("http://apache.org/hello_world_rpclit", "SoapPortRPCLit");
+
+    public static class Server extends TestServerBase {
+
+        protected void run()  {
+            Object implementor = new RPCLitGreeterImpl();
+            String address = "http://localhost:9002/SOAPServiceRPCLit/SoapPort";
+            Endpoint.publish(address, implementor);  
+        }
+
+        public static void main(String[] args) {
+            try { 
+                Server s = new Server(); 
+                s.start();
+            } catch (Exception ex) {
+                ex.printStackTrace();
+                System.exit(-1);
+            } finally { 
+                System.out.println("done!");
+            }
+        }
+    }
+   
+    public static Test suite() throws Exception {
+        TestSuite suite = new TestSuite(ClientServerRPCLitTest.class);
+        return new ClientServerSetupBase(suite) {
+            public void startServers() throws Exception {
+                assertTrue("server did not launch correctly", launchServer(Server.class));
+            }
+        };
+    }
+    
+    public void testBasicConnection() throws Exception {
+
+        SOAPServiceRPCLit service = new SOAPServiceRPCLit();
+        assertNotNull(service);
+
+        GreeterRPCLit greeter = service.getPort(portName, GreeterRPCLit.class);
+
+        MyComplexStruct in = new MyComplexStruct(); 
+        in.setElem1("elem1");
+        in.setElem2("elem2");
+        in.setElem3(45);
+
+        try {            
+            MyComplexStruct out = greeter.sendReceiveData(in); 
+            assertNotNull("no response received from service", out);
+            assertEquals(in.getElem1(), out.getElem1());
+            assertEquals(in.getElem2(), out.getElem2());
+            assertEquals(in.getElem3(), out.getElem3());
+        } catch (UndeclaredThrowableException ex) {
+            throw (Exception) ex.getCause();
+        }
+        
+    }
+}

Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/jaxws/ClientServerRPCLitTest.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message