camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Came <>
Subject RE: Generic file -> CXF Payload type converter issues
Date Mon, 07 Mar 2011 05:58:33 GMT
Thanks, Willem.  I thought I had tried setting the operation on the endpoint but still had
a problem...I'll try it again to see if I can get it working.

I looked at the test code you submitted, and see how to set the operation there (via a header).
 All of the examples at [1] set the header value within a custom that the only
way to do it, or is there a way to do it within the camel-context.xml, inside the cxf:cxfEndpoint?
 When I tried it before, I set the defaultOperationName and defaultOperationNamespace on the
URI, but as I mentioned, that didn't work for me...




-----Original Message-----
From: Willem Jiang [] 
Sent: Sunday, March 06, 2011 8:44 PM
Subject: Re: Generic file -> CXF Payload type converter issues

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/></s
> oap: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] 
> main/java/org/apache/camel/component/cxf/converter/CxfPayloadConverter
> .java

Blog: (English)
Twitter: willemjiang

View raw message