You are not logged in.
Announcement
Unanswered posts
|
Pages: 1

Hi,
I want to add a new operation to the WSDL of a Camel route exposed as a web service with CXF,
and a specific route for this operation.
What I don't know is how I can differentiate request to execute the right route...
Do I have to implement a CXF SOAPAction interceptor ? Is there a native mechanism in Camel to do that ?
That's how I've declared my CXF Endpoint :
<cxf:cxfEndpoint id="CXFTESBRouteService"
address="/WSRouteService"
serviceClass="com.talend.demo.ws_routeservice.WSRouteService"
wsdlURL="classpath:WEB-INF/WS_TalendESBDemo.wsdl" />That's my (very simple) route :
from("cxf:bean:CXFTESBRouteService").to("log:test");Thanks !
Last edited by bahaaldine (2011-06-13 13:26:42)
Offline

Hi,
Looks like you're implementing a service with multiple operations. So what you are asking, I think, is what is the differentiator that would tell you on a route what operation was invoked. The answer to that is a header called "operationName".
The easiest way to implement what you want would be using a content based router or, in a bit more elegant way, using a recipient list using one route/endpoint per operation, kinda like below (assuming your wsdl contract has operations named "myOperation1" and "myOperation2"):
from("cxf:bean:CXFTESBRouteService")
.to("log:test")
.recipientList(simple("direct:${header.operationName}"));
from("direct:myOperation1").whatever-needs-to-be-done-for-myOperation1();
from("direct:myOperation2").whatever-needs-to-be-done-for-myOperation2();
[...]You can see an example of the above in action in the camel-example-cxf-tomcat shipped with the distribution.
I hope this helps.
Offline

That's what I was looking for ![]()
Thank you Hadrian !
Bahaaldine
Offline
Pages: 1