cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t..@apache.org
Subject svn commit: r442901 - in /incubator/cxf/trunk: rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCInInterceptor.java systests/src/test/java/org/apache/cxf/jaxws/ClientServerRPCLitTest.java
Date Wed, 13 Sep 2006 08:51:11 GMT
Author: tli
Date: Wed Sep 13 01:51:10 2006
New Revision: 442901

URL: http://svn.apache.org/viewvc?view=rev&rev=442901
Log:
CXF-75 add more rpc test and return type processing

Modified:
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCInInterceptor.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/jaxws/ClientServerRPCLitTest.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=442901&r1=442900&r2=442901
==============================================================================
--- 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
Wed Sep 13 01:51:10 2006
@@ -76,10 +76,8 @@
         DataReader<Message> dr = getMessageDataReader(message);
 
         if (!isRequestor(message)) {
-            System.out.println("Server");
             msg = operation.getInput().getMessageInfo();
         } else {
-            System.out.println("Client");
             msg = operation.getOutput().getMessageInfo();
         }
 
@@ -101,9 +99,26 @@
                 message.setContent(Exception.class, new RuntimeException(expMessage));
             }
             Method meth = (Method) operation.getOperationInfo().getProperty(Method.class.getName());
-            System.out.println("meth is null = " + (meth == null));
-            Object param = dr.read(elName, message, meth.getParameterTypes()[idx]);
-            parameters.add(param);
+            Object param = null;
+            if (!isRequestor(message)) {                
+                if (meth.getParameterTypes() != null && meth.getParameterTypes().length
> idx) {
+                    param = dr.read(elName, message, meth.getParameterTypes()[idx]);
+                } else {
+                    throw new RuntimeException("can't match the method param no." + idx
+                                    + " with message part " + p.getName());
+                }
+            } else {
+                if (idx == 0 && meth.getReturnType() != null) {
+                    param = dr.read(elName, message, meth.getReturnType());
+                } else {
+                    // to do, handle holder
+                }
+            }
+            if (param != null) {
+                parameters.add(param);
+            } else {
+                throw new RuntimeException(p.getName() + " can not be unmarshalled");   
            
+            }
         }
         message.setContent(List.class, parameters);
     }

Modified: 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=diff&rev=442901&r1=442900&r2=442901
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/jaxws/ClientServerRPCLitTest.java
(original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/jaxws/ClientServerRPCLitTest.java
Wed Sep 13 01:51:10 2006
@@ -71,6 +71,30 @@
     }
     
     public void testBasicConnection() throws Exception {
+        
+        SOAPServiceRPCLit service = new SOAPServiceRPCLit();
+        assertNotNull(service);
+        
+        String response1 = new String("Hello Milestone-");
+        String response2 = new String("Bonjour");
+        try {
+            GreeterRPCLit greeter = service.getPort(portName, GreeterRPCLit.class);
+            for (int idx = 0; idx < 5; idx++) {
+                String greeting = greeter.greetMe("Milestone-" + idx);
+                assertNotNull("no response received from service", greeting);
+                String exResponse = response1 + idx;
+                assertEquals(exResponse, greeting);
+
+                String reply = greeter.sayHi();
+                assertNotNull("no response received from service", reply);
+                assertEquals(response2, reply);
+            }
+        } catch (UndeclaredThrowableException ex) {
+            throw (Exception)ex.getCause();
+        }
+    }
+    
+    public void testComplexType() throws Exception {
         SOAPServiceRPCLit service = new SOAPServiceRPCLit();
         assertNotNull(service);
 



Mime
View raw message