Hi all, Firstly I would like to point out that I am new to Camel(<24 hours), and I am working on a code assessment for a Job interview, which requires Camel to be used, so if this constitutes a "Help me with my homework" type post, please feel free to ignore.
The purpose of the assessment is to poll a directory for a CSV file and when a CSV file is found route the contents of the CSV file to a (Jax-WS) Web Service that is running in Apache CXF. I have nearly all of this completed, but I am struggling with how to route the CSV file to the Web Service. Let me explain: The CSV file has 4 fields, date, to, from, and value. The WebService takes in 4 parameters, but the types are XMLGregorianCalendar, String, String, BigDecimal. This has already been defined via WSDL file that came with the assessment, and the WS was created from the WSDL file using the WSDL2Java process from Apache CXF. My current route is defined as so: from(FILE PATH) .unmarshal() .csv() .split().body(List.class) .to(cxf:// http://localhost:8090/soap/Payments?serviceClass=PaymentsWebService"); When I use this route, I get a IllegalArgumentException from the WS: *IllegalArgumentException: Part { http://www.prototype.com/soap/examples/Payments.wsdl}date should be of type javax.xml.datatype.XMLGregorianCalendar, not java.lang.String* Which is fair enough as in the previous route, I would of only been using Strings, and not the other Types of each parameter. This lead me to the the TypeConverters, so what I did was I created a POJO for the entries in the CSV file, and then created a TypeConverter for this, and I updated my route as so: from(FILE PATH) .unmarshal() .csv() .split().body(List.class).convertBodyTo(Payment.class) .to(cxf:// http://localhost:8090/soap/Payments?serviceClass=PaymentsWebService"); But now when the web service is called, I am only sending one parameter to it, and I receive an exception: *IllegalArgumentException: Get the wrong parameter size to invoke the out service, Expect size 4, Parameter size 1. Please check if the message body matches the CXFEndpoint POJO Dataformat request.* Can someone point me in the right direction? I am constrained in that I cannot change the WS, so I need a way to route the contents of the CSV file, to the WS,and converting the properties that need converting from a string along the way. Regards John