Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Camel route web service & SOAPAction

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 !
Labels (2)
3 Replies
Anonymous
Not applicable
Author

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.
Anonymous
Not applicable
Author

Since you mentioned SOAPAction explicitly, Camel also propagates the cxf Header.HEADER_LIST and SoapBindingContstants.SOAP_ACTION headers, so that should be available as well.
Anonymous
Not applicable
Author

That's what I was looking for 0683p000009MACn.png
Thank you Hadrian !
Bahaaldine