cCXF : How to

One Star

cCXF : How to

Hi, 
I just start using Talend ESB and I've some difficulties to implement a Webservice SOAP with the cCXF component.
In fact, 
my problem is "how can I generate the response?".
First of all, 
I defined 3 beans in Talend Code section : 

wsRequest
wsResponse
wsInterface which describe a method that take wsRequest in parameter and provide a wsResponse .
I try to generate a WS with cCXF by configuring ServiceClass and fill it with an interface I defined in Beans.
I put the component in POJO mode but I don't now how to handle the request and how to generate the response.
If someone can share a little example with a cCXF componant, handle the request and generate a response it would be great.
Regards,
Mike
PS: I don't want to create the response by generating XML with a String (or StringBuilder) in a cProcessor. I'm sure there is a better to generate a response that is right with the wsdl's contract.
Moderator

Re: cCXF : How to

Hi,
Have you already checked component reference: TalendHelpCenter:cCXF?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: cCXF : How to

Hello, 
Yes I read this page a couple of time and I learn how to make webservice with serviceClass.
But, there is no example on how to handle the request in pojo and how to generate a response with a pojo.
Mike
One Star

Re: cCXF : How to

Ok, 
Just an update on my question with my answer
Here the route I made : 

First, 
I create 3 beans in talend :

testWSDLBean
testRequestBean
testResponseBean

where testWSDLBean define an simple interface which used the 2 others beans: 

I define my cCXF like this : 
Class : "beans.testWSDLBean"
Format : POJO
I add a cConvertBodyTo and I define the target class with beans.testRequestBean.class
I send it to a Queue and finally I generate the response of the webservice's call with a cProcessor : 
/*
* Provide own codes to consume or translate the message exchanges.
* @param org.apache.camel.Exchange exchange
*/
beans.testResponseBean retour = new beans.testResponseBean();
retour.setMessage("OK");
retour.setCode("0000");
exchange.getOut().setBody(retour, beans.testResponseBean.class);

I don't know if my solution is a good one or not and especially, the last part in the cProcessor generating the response.
Anybody can valid or not my solution?
Is there an other way to generate the response?
Regards,
Mike