IV Axis client implementation

Client code generation

To generate the java code for the axis client from the definition.wsdl file :

  1. Create a new Dynamic Web Project called AxisTutorialClient
  2. Right-click on the definition.wsdl file in the Eclipse Project Explorer view
  3. Choose : Web Services > Generate Client

Choose Install service in the top left spinner, and select :

  • the target Server (Tomcat)
  • the target Web service runtime (Axis)
  • the Service project (AxisTutorialClient)

Axis client code generation

Click the Next button and select the custom mapping option :

Axis custom mapping option

Select a target package for types in the namespace http://axis.tutorial/AxisTutorial :

Axis custom mapping definition

Click the Finish button. The client sources are generated under the axis.tutorial package of the AxisTutorialClient Project :

AxisTutorialClient project

Client implementation

To call the service, you just have to get a new AxisTutorialProxy instance and call it's getById function :

Download the example index.jsp page to test your brand new web service. Copy it into the /WebContent folder of the AxisTutorialClient project. Start Tomcat and open the URL http://localhost:8080/AxisTutorialClient/.

Axis test page

Axis test page