CXF Tomcat Example
Available as of Camel 2.5
This example is located in the
If you use maven then you can easily package the example from the command line:
This example demonstrates how you can use CXF to expose a web service in Camel using code first approach.
The web service we want to expose is defined as an interface which has 2 operations:
In this example we are not using any JAX-WS annotations. You can use those annotations to fine control the web service wsdl contract.
In the Camel route we expose this web service very easily using the Camel CXF component.
This means Camel will expose the web service using the relative address
In this example we want to be flexible, so if we add a 3rd operation to the web service we want it to be easily to add a route to handle this operation. Therefore we use the Recipient List EIP pattern to route to the route which handles the given operation. Notice how we use a Direct endpoint to link the routes.
Running the example
This example runs in Apache Tomcat, so you will have to package the .war file and copy it to the
Note: You have to use the version number of Camel you use. In this documentation we are using 2.5.0.
You can then use SoapUI or another web service client and send a request to the
The wsdl is located at: