Author: ningjiang
Date: Wed Jul 22 09:25:04 2009
New Revision: 796639
URL: http://svn.apache.org/viewvc?rev=796639&view=rev
Log:
CAMEL-1845 fixed the camel-cxf example issue with ActiveMQ 5.3.0.x-fuse
Modified:
camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfBinding.java
Modified:
camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfBinding.java
URL:
http://svn.apache.org/viewvc/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfBinding.java?rev=796639&r1=796638&r2=796639&view=diff
==============================================================================
---
camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfBinding.java
(original)
+++
camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfBinding.java
Wed Jul 22 09:25:04 2009
@@ -94,21 +94,21 @@
answer = new MessageImpl();
}
org.apache.camel.Message in = exchange.getIn();
-
+
// Check the body if the POJO parameter list first
- try {
- List body = in.getBody(List.class);
+ Object body = in.getBody();
+ if (body instanceof List) {
// just set the operation's parameter
answer.setContent(List.class, body);
CxfHeaderHelper.propagateCamelToCxf(strategy, in.getHeaders(),
answer);
- } catch (NoTypeConversionAvailableException ex) {
+ } else {
// CXF uses StAX which is based on the stream API to parse the XML,
// so the CXF transport is also based on the stream API.
// And the interceptors are also based on the stream API,
// so let's use an InputStream to host the CXF on wire message.
try {
- InputStream body = in.getBody(InputStream.class);
- answer.setContent(InputStream.class, body);
+ InputStream is = in.getBody(InputStream.class);
+ answer.setContent(InputStream.class, is);
} catch (NoTypeConversionAvailableException ex2) {
// ignore
}