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 13:00:08 GMT
Repository: cxf
Updated Branches:
  refs/heads/2.7.x-fixes ea28479d6 -> fd54d642f


[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/fd54d642
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/fd54d642
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/fd54d642

Branch: refs/heads/2.7.x-fixes
Commit: fd54d642fa155927e2af58568762e38e0ad08001
Parents: ea28479
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:59:48 2014 +0100

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


http://git-wip-us.apache.org/repos/asf/cxf/blob/fd54d642/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
index 2f502a2..1cb6d53 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
@@ -895,6 +895,12 @@ public abstract class AbstractClient implements Client, Retryable {
         }
     }
     
+    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/fd54d642/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
index 88ea621..f5fe9e0 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
@@ -643,7 +643,7 @@ public class ClientProxyImpl extends AbstractClient implements
             }
             Message outMessage = createMessage(body, ori.getHttpMethod(), headers, uri, 
                                                exchange, invocationContext, true);
-            
+            setSupportOnewayResponseProperty(outMessage);
             outMessage.getExchange().setOneWay(ori.isOneway());
             outMessage.setContent(OperationResourceInfo.class, ori);
             setPlainOperationNameProperty(outMessage, ori.getMethodToInvoke().getName());

http://git-wip-us.apache.org/repos/asf/cxf/blob/fd54d642/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java
index da20bbf..4d39095 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java
@@ -1094,7 +1094,7 @@ public class WebClient extends AbstractClient {
         URI uri = getCurrentURI();
         Message m = createMessage(body, httpMethod, headers, uri, exchange, 
                 invContext, false);
-        
+        setSupportOnewayResponseProperty(m);
         Map<String, Object> reqContext = getRequestContext(m);
         reqContext.put(Message.HTTP_REQUEST_METHOD, httpMethod);
         reqContext.put(REQUEST_CLASS, requestClass);

http://git-wip-us.apache.org/repos/asf/cxf/blob/fd54d642/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 c5f8e7e..f9c5188 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
@@ -1589,7 +1589,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