camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject [1/2] git commit: CAMEL-7061 Fixed the issue of DefaultCxfRsBinding only uses Exchange.getOut() with thanks to Dominik
Date Thu, 12 Dec 2013 12:14:07 GMT
Updated Branches:
  refs/heads/master be6876ea7 -> 2170352c3


CAMEL-7061 Fixed the issue of DefaultCxfRsBinding only uses Exchange.getOut() with thanks
to Dominik


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

Branch: refs/heads/master
Commit: fffd1393bda6bbc01b43514f6fde2279829a9b0d
Parents: be6876e
Author: Willem Jiang <willem.jiang@gmail.com>
Authored: Thu Dec 12 19:04:06 2013 +0800
Committer: Willem Jiang <willem.jiang@gmail.com>
Committed: Thu Dec 12 19:04:06 2013 +0800

----------------------------------------------------------------------
 .../component/cxf/jaxrs/DefaultCxfRsBinding.java  | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/fffd1393/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/DefaultCxfRsBinding.java
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/DefaultCxfRsBinding.java
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/DefaultCxfRsBinding.java
index 2bf135e..7a3d3c8 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/DefaultCxfRsBinding.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/DefaultCxfRsBinding.java
@@ -75,8 +75,22 @@ public class DefaultCxfRsBinding implements CxfRsBinding, HeaderFilterStrategyAw
         if (camelExchange.isFailed()) {
             throw camelExchange.getException();
         }
-        
-        return camelExchange.getOut().getBody();
+
+        org.apache.camel.Message response;
+        if (camelExchange.getPattern().isOutCapable()) {
+            if (camelExchange.hasOut()) {
+                response = camelExchange.getOut();
+                LOG.trace("Get the response from the out message");
+            } else {
+                response = camelExchange.getIn();
+                LOG.trace("Get the response from the in message as a fallback");
+            }
+        } else {
+            response = camelExchange.getIn();
+            LOG.trace("Get the response from the in message");
+        }
+
+        return response.getBody();
     }
 
     public void populateExchangeFromCxfRsRequest(org.apache.cxf.message.Exchange cxfExchange,


Mime
View raw message