cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject git commit: [CXF-5795] Enabling the processing of 202 responses if the request is not explicitly oneway
Date Thu, 14 Aug 2014 12:49:51 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 91f89e489 -> 2f94a81ca


[CXF-5795] Enabling the processing of 202 responses if the request is not explicitly oneway


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/2f94a81c
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/2f94a81c
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/2f94a81c

Branch: refs/heads/master
Commit: 2f94a81ca8586fef819fc94f13a454f7dd3d64cc
Parents: 91f89e4
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Thu Aug 14 13:49:20 2014 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Thu Aug 14 13:49:20 2014 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/cxf/jaxrs/client/AbstractClient.java  | 6 ++++++
 .../main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java | 1 +
 .../src/main/java/org/apache/cxf/jaxrs/client/WebClient.java   | 1 +
 .../apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java    | 1 -
 4 files changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/2f94a81c/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
----------------------------------------------------------------------
diff --git a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
index b4e9fad..53fca45 100644
--- a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
+++ b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
@@ -866,6 +866,12 @@ public abstract class AbstractClient implements Client {
         }
     }
     
+    protected void setSupportOnewayResponseProperty(Message outMessage) {
+        if (!outMessage.getExchange().isOneWay()) {
+            outMessage.put(Message.PROCESS_ONEWAY_RESPONSE, true);
+        }
+    }
+    
     protected Message createMessage(Object body,
                                     String httpMethod, 
                                     MultivaluedMap<String, String> headers,

http://git-wip-us.apache.org/repos/asf/cxf/blob/2f94a81c/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
----------------------------------------------------------------------
diff --git a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
index b151398..a4f0a5c 100644
--- a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
+++ b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
@@ -651,6 +651,7 @@ public class ClientProxyImpl extends AbstractClient implements
                 outMessage.put(Type.class, ori.getMethodToInvoke().getGenericParameterTypes()[bodyIndex]);
             }
             outMessage.getExchange().setOneWay(ori.isOneway());
+            setSupportOnewayResponseProperty(outMessage);
             outMessage.setContent(OperationResourceInfo.class, ori);
             setPlainOperationNameProperty(outMessage, ori.getMethodToInvoke().getName());
             outMessage.getExchange().put(Method.class, ori.getMethodToInvoke());

http://git-wip-us.apache.org/repos/asf/cxf/blob/2f94a81c/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java
----------------------------------------------------------------------
diff --git a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java
index 16ac260..10fd904 100644
--- a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java
+++ b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java
@@ -1112,6 +1112,7 @@ public class WebClient extends AbstractClient {
         URI uri = getCurrentURI();
         Message m = createMessage(body, httpMethod, headers, uri, exchange, 
                 invContext, false);
+        setSupportOnewayResponseProperty(m);
         if (inAnns != null) {
             m.put(Annotation.class.getName(), inAnns);
         }

http://git-wip-us.apache.org/repos/asf/cxf/blob/2f94a81c/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
index bc1bb7c..09f6d72 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
@@ -1624,7 +1624,6 @@ public class JAXRSClientServerBookTest extends AbstractBusClientServerTestBase
{
     @Test
     public void testEchoBookName202() throws Exception {
         WebClient wc = WebClient.create("http://localhost:" + PORT + "/bookstore/booksecho202");
-        WebClient.getConfig(wc).getRequestContext().put(Message.PROCESS_ONEWAY_RESPONSE,
true);
         wc.type("text/plain").accept("text/plain");
         Response r = wc.post("book");
         assertEquals(202, r.getStatus());


Mime
View raw message