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 2014/09/24 07:42:29 UTC
[3/3] git commit: CAMEL-7856 camel-cxf producer HttpAPI should not
send the message body when using DELETE method
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/10cc8249
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/10cc8249
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/10cc8249
Branch: refs/heads/master
Commit: 10cc8249df115741d929b3287b4a384d40fb1961
Parents: 198f270
Author: Willem Jiang <wi...@gmail.com>
Authored: Wed Sep 24 13:41:41 2014 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Wed Sep 24 13:41:41 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/10cc8249/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 7d6dec2..b023a8f 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
@@ -164,8 +164,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/10cc8249/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>