cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject svn commit: r469407 - in /incubator/cxf/trunk: rt/core/src/main/java/org/apache/cxf/interceptor/ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/ systests/src/test/java/org/apache/cxf/systest/jaxws/ testutils/src/main/java/org/apache/...
Date Tue, 31 Oct 2006 08:11:29 GMT
Author: mmao
Date: Tue Oct 31 00:11:28 2006
New Revision: 469407

URL: http://svn.apache.org/viewvc?view=rev&rev=469407
Log:
* Fixed the HTTP GET wrapped style.

Modified:
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/URIMappingInterceptor.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassInInterceptor.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java
    incubator/cxf/trunk/testutils/src/main/java/org/apache/hello_world_soap_http/GreeterImpl.java

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/URIMappingInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/URIMappingInterceptor.java?view=diff&rev=469407&r1=469406&r2=469407
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/URIMappingInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/URIMappingInterceptor.java
Tue Oct 31 00:11:28 2006
@@ -39,6 +39,7 @@
 import org.apache.cxf.service.Service;
 import org.apache.cxf.service.factory.MethodDispatcher;
 import org.apache.cxf.service.model.BindingOperationInfo;
+import org.apache.cxf.service.model.MessagePartInfo;
 import org.apache.cxf.service.model.ServiceModelUtil;
 
 public class URIMappingInterceptor extends AbstractInDatabindingInterceptor {
@@ -55,7 +56,8 @@
         String method = (String)message.get(Message.HTTP_REQUEST_METHOD);
         LOG.info("Invoking HTTP method " + method);
         BindingOperationInfo op = message.getExchange().get(BindingOperationInfo.class);
-        if (!"GET".equalsIgnoreCase(method)) {
+        if (!isGET(message)) {
+            LOG.info("URIMappingInterceptor can only handle HTTP GET, not HTTP " + method);
             return;
         }
         if (op != null) {
@@ -74,7 +76,7 @@
         message.setContent(List.class, getParameters(message, op));
     }
 
-    private Method getMethod(Message message, BindingOperationInfo operation) {
+    private Method getMethod(Message message, BindingOperationInfo operation) {        
         MethodDispatcher md = (MethodDispatcher) message.getExchange().
             get(Service.class).get(MethodDispatcher.class.getName());
         return md.getMethod(operation);

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassInInterceptor.java?view=diff&rev=469407&r1=469406&r2=469407
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassInInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassInInterceptor.java
Tue Oct 31 00:11:28 2006
@@ -21,6 +21,7 @@
 
 import java.lang.reflect.Method;
 import java.util.List;
+import java.util.logging.Logger;
 
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.interceptor.Fault;
@@ -36,6 +37,8 @@
 
 public class WrapperClassInInterceptor extends AbstractPhaseInterceptor<Message> {
 
+    private static final Logger LOG = Logger.getLogger(WrapperClassInInterceptor.class.getName());
+    
     public WrapperClassInInterceptor() {
         super();
         setPhase(Phase.POST_LOGICAL);
@@ -98,7 +101,10 @@
                 message.getExchange().put(BindingOperationInfo.class, boi2);
                 message.getExchange().put(OperationInfo.class, op);
             }
-            
+            if (isGET(message)) {
+                LOG.info("WrapperClassInInterceptor skipped in HTTP GET method");
+                return;
+            }
             if (lst != null && lst.size() == 1) {
                 if (messageInfo.getMessageParts().size() > 0) {
                     Object wrappedObject = lst.get(0);

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java?view=diff&rev=469407&r1=469406&r2=469407
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java
(original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java
Tue Oct 31 00:11:28 2006
@@ -529,8 +529,7 @@
         String response = (String) xu.getValue("//ns2:greetMeResponse/ns2:responseType/text()",

                                                body, 
                                                XPathConstants.STRING);
-        // TODO:wrong return type, should Hello cxf
-        assertEquals("Hello null", response);
+        assertEquals("Hello cxf", response);
     }
     
     public static void main(String[] args) {

Modified: incubator/cxf/trunk/testutils/src/main/java/org/apache/hello_world_soap_http/GreeterImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/testutils/src/main/java/org/apache/hello_world_soap_http/GreeterImpl.java?view=diff&rev=469407&r1=469406&r2=469407
==============================================================================
--- incubator/cxf/trunk/testutils/src/main/java/org/apache/hello_world_soap_http/GreeterImpl.java
(original)
+++ incubator/cxf/trunk/testutils/src/main/java/org/apache/hello_world_soap_http/GreeterImpl.java
Tue Oct 31 00:11:28 2006
@@ -56,7 +56,7 @@
     }
 
     public String greetMe(String me) {
-        LOG.info("Invoking greetMe");
+        LOG.info("Invoking greetMe " + me);
         invocationCount++;
         return "Hello " + me;
     }



Mime
View raw message