camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <>
Subject Re: Generic file -> CXF Payload type converter issues
Date Mon, 07 Mar 2011 04:44:28 GMT
Hi Scott,

I just create a simple test to reproduce the error and found you need to 
specify a right operation in you cxf endpoint to make sure the elements 
of the PayLoad Message can be set rightly into the CXF request message.

So I create a JIRA[1] and commit a quick fix[2] for it.


On 3/5/11 9:41 AM, Scott Came wrote:
> Per Willem's advice [1] I have attempted to bring in the CxfPayloadConverter from 2.7-SNAPSHOT
[2] so that I can make the following Camel route work:
> <osgi:camelContext xmlns="">
>      <route>
>        <from uri="file:/tmp/tsc-input"/>
>        <to uri="cxf:bean:outEndpoint?dataFormat=PAYLOAD"/>
>      </route>
>    </osgi:camelContext>
> I am able to build and deploy the converter just fine within my osgi bundle.  However,
I've run into a problem whereby the body on the converted message is empty.  I know this because
I am routing the outbound message through tcpmon, and it just has a<soap:Body/>  element
where the body should be:
> Content-Type: text/xml; charset=UTF-8
> SOAPAction: ""
> Accept: */*
> User-Agent: Apache CXF 2.3.2-fuse-00-00
> Cache-Control: no-cache
> Pragma: no-cache
> Host:
> Connection: keep-alive
> Content-Length: 98
> <soap:Envelope xmlns:soap=""><soap:Body/></soap:Envelope>
> To try to identify the problem, I have reduced the converter down to a single method
(see attached, method genericFileToCxfPayload(...)).  The code is running, and when I set
the log level to debug, I see the full body in the debug messages.  So I am confident the
payload object being returned has a proper's just getting lost somewhere before
the message hits the wire.  How could that happen?
> Oddly enough, I discovered that not only was the GenericFile ->  CxfPayload converter
called, but it is also wanting to convert from CxfPayload ->  String.  I can't imagine
why this is the case.  I do have another OSGi bundle, with a camel route, deployed in this
same instance of servicemix, and that bundle's route does go from CxfPayload ->  String.
 But it is in a separate bundle, so my assumption would be that the type converter class would
not be accessible.  Is that assumption incorrect?  In any case, the debug message in the CxfPayloadToString
method in the attached does get called, and the payload.getBody() call there returns null.
> Thanks for any advice.
> --Scott
> [1]
> [2]

Blog: (English)
Twitter: willemjiang

View raw message