Apache Axis2 User's Guide - The Samples

The Axis2 Standard Distribution provides a number of samples you can use as a guide for implementing specific features and capabilities. These services are listed in this section.

Clients (in samples/userguide/src/userguide/clients):

EchoBlockingClient.java: A basic example of the send/receive MEP.

EchoBlockingDualClient.java: Specifies that the return message should be sent over a different channel than the request message.

EchoBlockingWsaBasedClient.java: Provides an example of using the capabilities of WS-Addressing action mapping.

EchoNonBlockingClient.java: Demonstrates an asynchronous request and using Callbacks.

EchoNonBlockingDualClient.java: Similar to above, but uses a separate listener for the response.

ClientForWebServiceWithModule.java: Simply makes a call to a service with engaged modules.

ClientSideModuleEngagement.java: Demonstrates the use of modules on the client side, in addition to the server side.

MailClient.java: Demonstrates the use of the Robust In-Only MEP.

PingClient.java: A simple "fire and forget" client.

RESTClient.java: Demonstrates the ability to request a REST response rather than a SOAP response. Also demonstrates setting arbitrary properties on the Options object.

TCPClient.java: Provides an example of using the TCP transport rather than HTTP.

Services (in samples/userguide):

Once you type ant command from AXIS2_HOME/samples/userguide you will see the following aar files.

MyService.aar: Provides simple "echo" and "ping" operations.

MyServiceWithModule.aar: Same as above, but demonstrates how to engage a module.

WsaMappingService.aar: Demonstrates the mapping of WS-Addressing actions.

Sample WSDL files (in samples/wsdl):

Axis2SampleDocLit.wsdl: Demonstrates the use of the Document/Literal WSDL pattern, rather than RPC.

perf.wsdl: Demonstrates the use of array values as input values.

Quick Start Guide samples (in samples)

These are the samples used in the Axis2 Quick Start Guide.

quickstart- Here we are deploying a POJO after writing a services.xml and creating an aar. We also test the gePrice and update methods using a browser.

quickstartadb - In this sample, we are deploying an ADB generated service. The service is tested using generated client stubs.

quickstartaxiom- Here we are deploying an AXIOM based POJO service after writing a services.xml and creating an aar. We also test successful deployment using an AXIOM based client.

quickstartjibx - In this sample, we are deploying a JiBX generated service. The service is tested using generated client stubs.

quickstartxmlbeans - We are deploying an XMLBEANS generated service in this sample. The service is tested using generated client stubs.

POJO Guide Samples (in samples)

These samples are used in the 'POJO Web Services using Apache Axis2' document.

pojoguide - This sample shows how to expose a Java class as a web service. The WeatherService Java class provides methods to get and set a Weather type Java objects. The client uses RPCServiceClient to invoke those two methods just as Java object method invocation.

pojoguidespring - This sample shows how to expose the getters and setters of WeatherSpringService that takes Weather type Java Object as the argument and the return type. It uses the Spring framework to initialize the weather property of the WeatherSpringService.

Other samples (in samples):

faulthandling: Demonstrates the use of SOAP faults and their definition in WSDL, enabling exception processing in the client.

googlespellcheck: Demonstrates both synchronous and non-synchronous use of the Google Web Service in a GUI.

mtom: Demonstrates the use of MTOM and SOAP with Attachments to send binary files to a service.

soapwithattachments: Demonstrates the capabilities and power of SOAP with Attachment support and the Attachment API of Axis2.

pojo: Example POJO (Plain Old Java Object) Web service. It shows how to expose the methods of a Java class as a Web service using Aixs2

servicelifecycle: Demonstrate usage of service life cycle and bit of session management. The main idea is to show where and how to use service life cycle interface and session related methods.

databinding: Demonstrates how to use WSDL2Java generated code with Castor.

version: A very simple service that simply outputs the Axis2 version.

yahoorestsearch: Complete example of the use of a REST service rather than a SOAP service.

See Next Section - For Further Study