camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject [1/3] git commit: CAMEL-7856 camel-cxf producer HttpAPI should not send the message body when using DELETE method
Date Wed, 24 Sep 2014 05:44:27 GMT
Repository: camel
Updated Branches:
  refs/heads/camel-2.12.x 2809e89cb -> 865c33bc0
  refs/heads/camel-2.13.x 2b1296e77 -> 5b4abb619
  refs/heads/camel-2.14.x 1772cecdf -> 3eb7ce323


CAMEL-7856 camel-cxf producer HttpAPI should not send the message body when using DELETE method


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

Branch: refs/heads/camel-2.14.x
Commit: 3eb7ce3238446c77940ae27d2f73af90b91e9c9c
Parents: 1772cec
Author: Willem Jiang <willem.jiang@gmail.com>
Authored: Wed Sep 24 13:41:41 2014 +0800
Committer: Willem Jiang <willem.jiang@gmail.com>
Committed: Wed Sep 24 13:43:34 2014 +0800

----------------------------------------------------------------------
 .../java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java | 4 ++--
 .../org/apache/camel/component/cxf/jaxrs/CxfRsSpringRouter.xml   | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/3eb7ce32/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java
index 804a51cf..c0798fa 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java
@@ -158,8 +158,8 @@ public class CxfRsProducer extends DefaultProducer {
 
         // set the body
         Object body = null;
-        if (!"GET".equals(httpMethod)) {
-            // need to check the request object.           
+        if (!"GET".equals(httpMethod) && !"DELETE".equals(httpMethod)) {
+            // need to check the request object if the http Method is not GET or DELETE 
         
             body = binding.bindCamelMessageBodyToRequestBody(inMessage, exchange);
             if (LOG.isTraceEnabled()) {
                 LOG.trace("Request body = " + body);

http://git-wip-us.apache.org/repos/asf/camel/blob/3eb7ce32/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringRouter.xml
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringRouter.xml
b/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringRouter.xml
index 154b572..9f51dd6 100644
--- a/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringRouter.xml
+++ b/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringRouter.xml
@@ -64,6 +64,7 @@
   <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
     <route>
        <from uri="cxfrs://bean://rsServer"/>
+       <to uri="log:body?level=INFO"/>
        <!-- We can remove this configure as the CXFRS producer is using the HttpAPI by
default -->
        <setHeader headerName="CamelCxfRsUsingHttpAPI">
          <constant>True</constant>        


Mime
View raw message