Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Tutorial using Axis 1.4 with Apache Camel

Info
titleRemoved from distribution

This example has been removed from Camel 2.9 onwards. Apache Axis 1.4 is a very old and unsupported framework. We encourage users to use CXF instead of Axis.

Table of Contents

Prerequisites

...

Then we can hit the web browser and enter this URL: http://localhost:8080/camel-example-axis/servicesImage Removed and you should see the famous Axis start page with the text And now... Some Services.

...

We want to store the web service request as a file before we return a response. To do this we want to send the file content as a message to an endpoint that produces the file. So we need to do two steps:

  • configure the file backup endpoint
  • send the message to the endpoint

The endpoint is configured in spring XML so we just add it as:

...

In the CamelContext we have defined our endpoint with the id backup and configured it use the URL notation that we know from the internet. Its a file scheme that accepts a context and some options. The contest is target and its the folder to store the file. The option is just as the internet with ? and & for subsequent options. We configure it to not append, meaning than any existing file will be overwritten. See the File component for options and how to use the camel file endpoint.

...

The template in the code above uses 4 parameters:

  • the endpoint name, in this case the id referring to the endpoint defined in Spring XML in the camelContext element.
  • the payload, can be any kind of object
  • the key for the header, in this case a Camel keyword to set the filename
  • and the value for the header

Running the example

We start our integration with maven using mvn jetty:run. Then we open a browser and hit http://localhost:8080Image Removed. Jetty is so smart that it display a frontpage with links to the deployed application so just hit the link and you get our application. Now we hit append /services to the URL to access the Axis frontpage. The URL should be http://localhost:8080/camel-example-axis/servicesImage Removed.

You can then test it using a web service test tools such as SoapUI.
Hitting the service will output to the console

...

Note that the code shown here also applies to Camel 1.4 so actually you can get started right away with the released version of Camel. As this time of writing Camel 1.5 is work in progress.

See Also