Camel CXF Component: Headers missing after service response

412 views Asked by At

My camel route is a CXF receiver & it needs to call another webService. I stored the request in header & requested second service. After getting response I am not able to retrieve the original request set in header. My route looks like:

 <route customId="true" id="wsRoute">
    <from uri="cxf:bean:ServiceEndpoint"/>
    <convertBodyTo type="com.customer.requestcustomeremail.SendEmailRequest"/>
    <setHeader headerName="req">
        <simple>${body}</simple>
    </setHeader>
    <to uri="bean:IDBReq"></to>
    <to uri="cxf:bean:idamServiceEndpoint"/>
    <setBody>
        <simple>
            ${header.req}
        </simple>
   </setBody>
   <to uri="bean:ServiceImpl?method=oper" />

Error Message: No body available of type:

com.customer.requestcustomeremail.SendEmailRequest but has value: com.customer.requestcustomeremail.SendEmailRequest@1bcd32c6 of type: java.lang.String on: Message[]. Caused by: No type converter available to convert from type: java.lang.String to the required type: com.customer.requestcustomeremail.SendEmailRequest with value com.customer.requestcustomeremail.SendEmailRequest@1bcd32c6. Exchange[ID-SYNPS31625-50686-1504258200956-0-2]. Caused by: [org.apache.camel.NoTypeConversionAvailableException - No type converter available to convert from type: java.lang.String to the required type: com.customer.requestcustomeremail.SendEmailRequest with value com.customer.requestcustomeremail.SendEmailRequest@1bcd32c6]

Can someone please help!

1

There are 1 answers

1
Victor Tripeno On

Your route cannot convert your body to com.customer.requestcustomeremail.SendEmailRequest type.