Skip to main content
Jump to: navigation, search

Use cases for Axis2 Integration in WTP

Revision as of 12:19, 27 November 2006 by (Talk | contribs)

Use cases for Axis2 Integration in WTP

There are a number of use cases for integrating Apache Axis2 Web services runtime into WTP.

Installing Axis2 Web service runtime

In order to let user create or consumme Axis2 Web service in an Eclispe workspace, the Web services tool needs to have access to the Axis2 JARs to put on the Web module containing the Web service. Currently, the latest Axis2 version available is Axis2 1.1. If the WTP tool ships a copy of the Axis2 JARs in a plugin, similar to the current implementation of Axis 1.3, we would need to keep shipping newer releases of Axis2 when it is available. Not only is this extra work for development team and legal team, it might not be what the user want since some user might want to get the latest Axis2 release but some might want to stay with a particular version. So the best approach is to let the user download the version of Axis2 they want and point the Web services tools in WTP to the location of the Axis2 JAR.

Detail steps

  1. In the Preference page, select Web services -> Install Web service runtime.
  2. Expand the Axis2 tree and select Axis2 1.1.
  3. Click a Browse button to specify the location of the Axis2 home directory.
  4. The install Web service runtime wizard would give user error message in the banner if Axs2 JARs cannot be loaded from the specified directory.
  5. Click Finish.

The above approach is similar to installing server runtime for Tomcat servers. The various Axis2 version are hard-coded (e.g. Axis2 1.1, 1.2 etc.) or if the various JARs that are needed to run Axis2 1.x Web service stays the same, it could be just presented as Axis2 1.x. However, if down the road when there are more Axis2 versions available and the JARs are different, the Web service runtime adapter for Axis2 would have to be updated to include the newer Axis2 versions explicitely.

Another approach is to add a 'Don't see your Web service runtime listed? Click here.' link in the Install Web Service Runtime page similar to the 'Don't see your server listed? Click here.' link in the Install Server Runtime. This is how Geronimo 1.0 and 1.1 servers can be dynamically discovered and loaded. With this approach, new Web service runtimes (such as different versions of Axis2) can be dynamically discovered and installed.

Adding Axis2 facet

When creating or consumming Axis2 Web service, the Axis2 JARs needs to be available to the Web module containing the Web service or Web service client. These JARs can be copied from the Web service runtime location during the wizard (similar to Axis 1.x) or could be installed in the Web project through a new Axis2 facet.

Detail steps

  1. When creating a dynamic Web project, select Next.
  2. Axis2 facet is one of the available facets to add to the project.
  3. Different versions of Axis2 can be selected by using the drop-down combo.
  4. The selected version of Axis2 JARs would be copied to the WEB-INF/lib directory of the destinated project when the user click Finish.

Creating or consumming Axis2 Web service

Axis2 is another Web service runtime supported similar to Axis 1.x runtime. It would be available via wizard, popups and Ant tasks. The Axis2 Web service runtime would extend the existing Web service creation framework in the various phases: develop, assemble, deploy, install, start and test.

Detail steps

  1. Select the Web service wizard or the Web service popup action.
  2. In the first page of the Web service wizard,
    1. Select the Web service type (bottom-up Java bean Web service or top-down Java bean Web service).
    2. Select the Service definition (Java bean) or Sevice Implementation (WSDL URI).
    3. Use the scale to specify develop, assemble, deploy, install, start or test.
    4. Click the Web service runtime hyperlink to change the Web service runtime to Axis2.
    5. Click the Server hyperlink to select a server supporting the Axis2 runtime.
    6. Click the Project link to select a project. If the project does not yet exist, it will be created. If an exsiting project does not already have the Axis2 facets installed,it would be added.
    7. Do similar selection on the client side if the user wants to segue to the client wizard.
  3. Click Next to get to the wizard page(s) contributed by the Axis2 extension.
  4. In the Axis2 contributed wizard page(s), select the various parameters needed for run the Axis2 java2WSDL and WSDL2Java code generators.
    • The wizard pages are simple with most commonly used controls exposed and more advanced controls hidden under sections/buttons or optional pages (similar to customize mapping checkbox in Axis 1.x support). The controls are defaulted based on the Axis2 preference page (similar to Axis 1.x emitter preference page).
    • Various WSDL, Java and deployment artifacts (such as services.xml) are generated by the Axis2 code generators.
    • The Axis2 code generator would read/write from/to the Eclipse workspace with no manual refresh required by user. Web service resource management preferences (file overwrite, folder creation, automatic checkout) are respected.
    • If the Web project already contains an existing Axis2 Web service, the generated services.xml is merged into service groups.
    • The generated artifacts would be organized into an exploded AAR structure so that it could be deployed to the server without the need for an explicit builder.
  5. When Next is clicked, the user proceeds to the other Web service wizard pages as defined by the Web services creation framework. This may include starting the server (if it is not already started) and testing the Web service using the Web Services Explorer.

Editing after Web service creation

After a Web service is created, the user can re-deploy the Web services in a number of ways:

  1. Edit the Java implementation file, update it and have the updates reflected on the deployed Web service without restarting the server (i.e. hot deployment).
  2. Change the service directory structure (e.g. change the parameters in services.xml) and have the updates reflected on the deployed Web service after a time interval (i.e. hot update).

AAR file export

Axis2 AAR exist only in exploded form in the workspace. User would use an AAR export wizard (similar to WAR export) to export AAR to file system.

Detail steps

  1. Select Export -> Web services -> Axis2 Archive (AAR)
  2. Select the project to export by entering the name or using a Browse button.
  3. Select the destination for the export.
  4. Click Finish.

Exploring Axis2 Web service in J2EE Project Explorer

  • After Axis2 Web services are created, it would show up in the J2EE Project Explorer view. It would either show up
    • beside the JSR-109 Web Services directory in a directory called Axis2 Web Services directory, or
    • under a directory called Web Services, which has 2 subdirectories called JSR-109 Web Services and another called Axis2 Web Services.
  • The user would be able to navigate to the various Axis2 Web services artifacts in the J2EE project Explorer view.

Back to the top