Author: ningjiang
Date: Mon Apr 16 04:25:01 2012
New Revision: 1326475

URL: http://svn.apache.org/viewvc?rev=1326475&view=rev
Log:
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.9.x/   (props changed)
    
camel/branches/camel-2.9.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java

Propchange: camel/branches/camel-2.9.x/
------------------------------------------------------------------------------
    svn:mergeinfo = /camel/trunk:1326469

Propchange: camel/branches/camel-2.9.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: 
camel/branches/camel-2.9.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
URL: 
http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java?rev=1326475&r1=1326474&r2=1326475&view=diff
==============================================================================
--- 
camel/branches/camel-2.9.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
 (original)
+++ 
camel/branches/camel-2.9.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
 Mon Apr 16 04:25:01 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();
                 }


Reply via email to