camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Came <>
Subject RE: File consumer to CXF issues
Date Sat, 26 Feb 2011 15:28:05 GMT
The file contains XML...the root element of the xml document in the file is the child element
of soap:body.

I tried MESSAGE and it seems the CXF component is expecting the file to contain the entire
SOAP message (envelope and body), which would be a pain to create.  I'd rather avoid POJO
mode since I really don't want to have to generate code.  But nonetheless I tried it and ran
into a whole bunch more exceptions...probably wasn't configuring it right.

I'd rather learn how to write a converter and do that than have to generate code.

How do I explore whether there is a converter missing?  Again, it's surprising that there
isn't a converter that will take a GenericFile (or String) and plop it into the soap:body,
since that seems like such a common there must be something I'm missing.


-----Original Message-----
From: Claus Ibsen [] 
Sent: Friday, February 25, 2011 11:35 PM
Subject: Re: File consumer to CXF issues


What does your file contain?

Often people use either POJO or MESSAGE format. So there could be a converter to/from CxfPayload
missing. Especially for String, byte[], streams which is common types.

On Sat, Feb 26, 2011 at 7:53 AM, Scott Came <> wrote:
> After looking at this a bit more (and upgrading to the 4.3.1-fuse-00-00 version of ServiceMix,
which contains Camel 2.6.0), it seems the problem boils down to Camel not knowing how to convert
a GenericFile (what results from the <from> part of the route) to a CxfPayload (what
is expected by the <to> part of the route).
> Am I on the right track here?
> If so, is there an available converter that does that?  It seems like a fairly common
scenario to pick up an XML document that fits the schema for a particular SOAP operation and
send that document in the body of a SOAP message to a web service.  So I'm surprised this
isn't built in...perhaps it is, and I'm just not doing something correctly.
> By the way, I tried using convertBodyTo to convert the input file to java.lang.String
and org.w3c.dom.Document, and those efforts resulted in exceptions too.
> Any help appreciated.
> Thanks.
> --Scott
> -----Original Message-----
> From: Scott Came []
> Sent: Friday, February 25, 2011 1:57 PM
> To:
> Subject: File consumer to CXF issues
> I have a route that looks like this:
> <osgi:camelContext xmlns="">
>    <route>
>      <from uri="file:/tmp/tsc-input"/>
>      <to uri="cxf:bean:outEndpoint"/>
>    </route>
>  </osgi:camelContext>
> (As you can tell, I'm deploying this in ServiceMix, but the issue I'm 
> having is in the Camel realm, thus my posting here...)
> I have defined outEndpoint earlier in the camel-context.xml file using cxfEndpoint.
> This route is creating exceptions over several different techniques.
> What I really would like is not to generate code using cxf's wsdl2java (following this
example ( though, I did).  I would
like to use <to uri="cxf:bean:outEndpoint?dataFormat=PAYLOAD"/> which, as I understand
it, should not require code generation.  However, when I try to do it this way, I get a NullPointerException
in org.apache.camel.component.cxf.CxfEndpoint, at line 577, in the setParameters() method.
> I don't see anything in the documentation of the Camel CXF component that states or implies
that this isn't supported on the client side.
> So my question is...  Is it possible to use the cxf component in the 
> <to> part of a Camel route, WSDL-first, and not generate code, but 
> rather have it (under the covers) use the JAX-WS Dispatch approach?  
> Is there an example anywhere that does this (I've looked at all the 
> examples on the Camel website, and several blog postings, and couldn't 
> find anything that matched my scenario...)
> If it would be better to post this on the CXF or even ServiceMix lists, please advise.
> Thanks.
> --Scott

Claus Ibsen
Twitter: davsclaus
Author of Camel in Action:

View raw message