# Creating Web services with the Apache Axis2 runtime environments

This runtime environment is for users who prefer to develop for the open Apache Axis platform. Both Axis1 and Axis2 are supported by the Web services tools.

#### Apache Axis2 Overview

Axis2 evolved from the Apache Axis1.x architecture and is more flexible, configurable, and efficient, while retaining the positive aspects of Apache Axis1.x architecture.

The Web service tools provided with this product support the following specifications when creating Apache Axis2 Web services and clients:

- SOAP 1.1 and 1.2
- WSDL 1.1, including both SOAP and HTTP bindings
- HTTP transports

The levels of Axis2 currently supported by the tools is 1.2 and 1.3. Axis2 can be deployed to any server that supports Java™ Servlet 2.2 specification or higher, including IBM® WebSphere® Application Server 6.1, and Apache Tomcat server. For more information on Axis2, refer to http://ws.apache.org/axis2.

The support for Apache Axis2 is limited to validation that the application is invoking the Axis2 emitters correctly. Support for other Axis2 issues should be directed to http://ws.apache.org/axis2

#### Installing the Apache Axis2 runtime

Unlike creating Web services in the Apache Axis1.x runtime, before creating a Web service using Apache Axis2 you must download the Axis2 runtime and install it the workbench using the Web services Axis2 preferences page.

1. Download Apache Axis2 v1.2 or v1.3 from the following site: http://ws.apache.org/axis2/download.cgi.
2. Follow the instructions in the appropriate Apache Axis2 installation guide:
   - Apache Axis2 v1.2http://ws.apache.org/axis2/1_2/installationguide.html
   - Apache Axis2 v1.3http://ws.apache.org/axis2/1_3/installationguide.html
3. Once the Apache Axis2 runtime is installed, you need to associate it with the workbench. In the workbench, open Window > Preferences > Web services > Axis2 Preferences. On the Axis2 Runtime tab, browse to the location where you installed Apache Axis2. A message will display if the runtime is installed successfully.

#### Creating projects for Axis2 Web services

The Web service wizards will automatically add the correct facets to a dynamic Web project. However if you want to manually create a dynamic Web project enabled for Axis2 Web service development complete the following:

1. Create the service Web project by clicking File > New > Project > Dynamic Web project. Enter the following information:
   1. Project Name: Type a project name
   2. If you are deploying to a Tomcat server, ensure that Add project to an EAR is not selected. If you do not clear this checkbox you will be unable to select the Tomcat server. If you are deploying to WebSphere Application server you will need to add the project to an EAR.
   3. Target runtime: Select the version of the server to which you will deploy your Web service. If it is not listed, click New and browse to the location where it is installed.
   4. Configurations: Select the default configuration for your server type.
   5. Click Finish.
2. Add the Axis2 facet. Right-click your project and click Properties > Project Facets > Modify project > Axis2 Web Services, and click Finish.
3. If you have chosen to deploy to a server in which the Axis2 JAR files will reside on the server (such as WebSphere Application Server), you must change the classloading for the EAR from PARENT_FIRST to PARENT_LAST. Expand the EAR associated with your Axis2 project, and launch its deployment descriptor. On the Deployment tab, expand the Application section. Change the Classloader mode field to PARENT_LAST and save your changes.

- Creating a Web service from a Java bean using the Apache Axis2 runtime environment
  The Web Service wizard assists you in creating a new Web service, configuring it for deployment, and deploying the Web service to a server. Once your Web service is deployed, the wizard assists you in generating the client proxy and sample application to test the Web service. When you have completed testing, you can publish your Web service to a UDDI Business Registry using the Export wizard.
- Creating a Java bean skeleton from a WSDL document using the Apache Axis2 runtime environment
  The Web service wizard assists you in creating a skeleton bean from an existing WSDL document. The skeleton bean contains a set of methods that correspond to the operations described in the WSDL document. When the bean is created, each method has a trivial implementation that you replace by editing the bean.
- Generating a Java client proxy and a sample application from a WSDL document using the Axis2 runtime environment
  The Web Service Client wizard assists you in generating a Java bean proxy and a sample application. The sample Web application demonstrates how to code a proxy file.

Related Concepts
Web services
Tools for Web services development
JAX-RPC
Related Tasks
Developing Web services