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 2012/04/16 07:18:11 UTC
svn commit: r1326485 - in /camel/branches/camel-2.8.x: ./
components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
Author: ningjiang
Date: Mon Apr 16 05:18:10 2012
New Revision: 1326485
URL: http://svn.apache.org/viewvc?rev=1326485&view=rev
Log:
Merged revisions 1326475 via svnmerge from
https://svn.apache.org/repos/asf/camel/branches/camel-2.9.x
................
r1326475 | ningjiang | 2012-04-16 12:25:01 +0800 (Mon, 16 Apr 2012) | 9 lines
Merged revisions 1326469 via svnmerge from
https://svn.apache.org/repos/asf/camel/trunk
........
r1326469 | ningjiang | 2012-04-16 10:57:17 +0800 (Mon, 16 Apr 2012) | 1 line
CAMEL-5176 CxfProducer should not always leverage the toList type converter to find out the parameters for invocation
........
................
Modified:
camel/branches/camel-2.8.x/ (props changed)
camel/branches/camel-2.8.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
Propchange: camel/branches/camel-2.8.x/
------------------------------------------------------------------------------
Merged /camel/trunk:r1326469
Merged /camel/branches/camel-2.9.x:r1326475
Propchange: camel/branches/camel-2.8.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified: camel/branches/camel-2.8.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java?rev=1326485&r1=1326484&r2=1326485&view=diff
==============================================================================
--- camel/branches/camel-2.8.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java (original)
+++ camel/branches/camel-2.8.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java Mon Apr 16 05:18:10 2012
@@ -274,21 +274,24 @@ public class CxfProducer extends Default
Object[] params = null;
if (endpoint.getDataFormat() == DataFormat.POJO) {
- List<?> list = exchange.getIn().getBody(List.class);
- if (list != null) {
- params = list.toArray();
+ Object body = exchange.getIn().getBody();
+ if (body instanceof Object[]) {
+ params = (Object[])body;
+ } else if (body instanceof List) {
+ // Now we just check if the request is List
+ params = ((List<?>)body).toArray();
} else {
// maybe we can iterate the body and that way create a list for the parameters
// then end users do not need to trouble with List
Iterator it = exchange.getIn().getBody(Iterator.class);
if (it != null && it.hasNext()) {
- list = exchange.getContext().getTypeConverter().convertTo(List.class, it);
+ List<?> list = exchange.getContext().getTypeConverter().convertTo(List.class, it);
if (list != null) {
params = list.toArray();
}
}
if (params == null) {
- // no we could not then use the body as single parameter
+ // now we just use the body as single parameter
params = new Object[1];
params[0] = exchange.getIn().getBody();
}