Apache Axis2 User's Guide - The Samples

The Apache 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.

Content

Clients (in AXIS2_HOME/modules/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 using Callbacks.

EchoNonBlockingDualClient.java: Similar to the 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 AXIS2_HOME/modules/samples/userguide):

Run ant generate.service in this directory to build the following services; they are copied to the repository/services directory with a sample- prefix.

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 AXIS2_HOME/modules/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.

Sample webapp that uses JSON, Spring Boot, Spring Security, and Moshi

A complete Axis2 webapp via Maven that demonstrates JSON and Moshi securely with Spring Boot is located in the "modules/samples/userguide/src/userguide/springbootdemo" directory of Axis2 standard binary distribution. Container-specific variants of the same application are in "springbootdemo-tomcat11" (Apache Tomcat 11) and "springbootdemo-wildfly" (WildFly) next to it; each has a README with build, deploy and test instructions.

Other samples

In AXIS2_HOME/modules/samples Directory:

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

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 of a POJO (Plain Old Java Object) Web service. It shows how to expose the methods of a Java class as a Web service using Apache Axis2.

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

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

quickstart, quickstartadb, quickstartaxiom, quickstartxmlbeans: The source code for the Quick Start Guide, building the same StockQuoteService with POJOs, ADB, AXIOM and XMLBeans.

pojoguide, pojoguidespring: The source code for the POJO Guide, including a Spring-based POJO service.

json: A JSON service using the native JSON support described in the JSON support documentation.

jaxws-addressbook, jaxws-calculator, jaxws-interop, jaxws-samples, jaxws-version: JAX-WS samples, covering JAXB-based services, code-first and WSDL-first development and deployment in a servlet container.

swagger-server: A REST service documented with OpenAPI; see the OpenAPI REST Services Guide.

See Next Section - For Further Study