You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2013/12/12 14:02:20 UTC

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

Updated Branches:
  refs/heads/camel-2.11.x 1fabe99de -> 55de0d8b0


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/55de0d8b
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/55de0d8b
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/55de0d8b

Branch: refs/heads/camel-2.11.x
Commit: 55de0d8b05ae2307db386fa98f8a0a1f733600c2
Parents: 1fabe99
Author: Willem Jiang <wi...@gmail.com>
Authored: Thu Dec 12 19:04:06 2013 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Thu Dec 12 20:53:20 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/55de0d8b/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,