Client API Sample Guide

Introduction

WSO2 AppServer (Axis2) Client API supports writing different kinds of clients to invoke Web Services. Most suitable type of client should be selected depending on the application and the nature of the service. This sample demonstrates following kinds of Clients that can be written using the Axis2 Client API.

  1. Blocking Client
  2. Single Channel Non Blocking Client
  3. Dual Channel Non Blocking Client
  4. Dynamic Blocking Client
  5. RPC Client
  6. Fire and Forget Client
  7. Send Robust Client
  8. Operation Client

Building the Service

To build the sample service, go to samples/ClientAPI directory and type: ant

This will build the ClientAPIDemoService.aar in the target directory and copy it to the CARBON_HOME/repository/servicejars directory. Now if you start AppServer, the deployed ClientAPIDemoService will be available under the services list.

The WSDL for this service should be viewable at:

                http://<host>:<port>/services/ClientAPIDemoService?wsdl
            

Running the Client

To run the sample client for the service, go to samples directory and type:

sh run-client.sh/run-client.bat

For more information, use "-help" option.

When you run the script, you can select the type of client that you want to run.

            1. Blocking Client
            2. Single Channel Non Blocking Client
            3. Dual Channel Non Blocking Client
            4. Dynamic Blocking Client
            5. RPC Client
            6. Fire and Forget Client
            7. Send Robust Client
            8. Operation Client
            9. Exit