0% found this document useful (0 votes)
10 views2 pages

Hands-On 1

This document provides a step-by-step guide for installing and setting up Axis2 on Windows to create a simple 'Hello World' web service. It includes instructions for configuring the environment, defining the service class, and deploying the service. The document also outlines how to access and test the web service once deployed.

Uploaded by

Maryem Khammar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views2 pages

Hands-On 1

This document provides a step-by-step guide for installing and setting up Axis2 on Windows to create a simple 'Hello World' web service. It includes instructions for configuring the environment, defining the service class, and deploying the service. The document also outlines how to access and test the web service once deployed.

Uploaded by

Maryem Khammar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Institut Supérieur d’Informatique et de Mathématiques

de Monastir
Web Services and Orchestration
MP1 GL- Hands-On : First Web Service with Axis2
Ikram Garfatta • Semestre 2 - 2025

1 Install Axis2 under Windows


1. Create a new folder which will be the directory of this lab. Name it tp-terminal.

2. Set the TPWS environment variable which will point to the directory tp-terminal:
set TPWS =[ your system path ]/ tp - terminal

3. Download Axis2-1.5.1:
cd %TPWS %
curl -o axis2 -1.5.1. zip https :// archive . apache . org / dist / ws / axis2 /1 _5_1 /
axis2 -1.5.1 - bin . zip

4. Unpack the downloaded folder.

5. Download the set-env.bat which will set all the required variables:

6. Open the downloaded file. Update the TPWS and JAVA_HOME variables. The TPWS should point
to your tp-terminal folder. The JAVA_HOME should point to your JDK directory.

7. Execute the set-env.bat file:


set - env . bat

8. Start Axis2:
%AXIS2_HOME %\bin \ axis2server . bat

9. Make sure to re-execute the set-env.bat file in each new terminal session.

2 Hello World Web Service using Axis2


The goal of this lab is to develop a first example of a web service using Axis2. This is simply
to display the famous: HELLO WORLD.

2.1 Directory/File Structure


- helloService
- META - INF
- services . xml
- hello
- HelloWorld . java

1
2.2 Define the HelloWorld.java Service Class
package hello ;

public class HelloWorld {

public String sayHello () {


return " Hello world !";
}
}

2.3 Define the Deployment File services.xml


< service name =" He lloWorld Service " scope =" application " >
< description >
Hello World Service
</ description >
< messageReceivers >
< messageReceiver mep =" http :// www . w3 . org /2004/08/ wsdl / in - only " class =" org .
apache . axis2 . rpc . receivers . R P C I n O n l y M e s s a g e R e c e i v e r "/ >
< messageReceiver mep =" http :// www . w3 . org /2004/08/ wsdl / in - out " class =" org .
apache . axis2 . rpc . receivers . R PC Mes sa ge Rec ei ve r "/ >
</ messageReceivers >
< parameter name =" ServiceClass " >
hello . HelloWorld
</ parameter >
</ service >

2.4 Deployment and Testing


1. Compile your program with:
javac HelloWorld . java

2. Deploy the service on Axis2 by copying the helloService directory to AXIS2_HOME/repository/service

3. Access the service list at: http://localhost:8080/axis2/services/.

4. Click on HelloWorldService to see its WSDL definition.

5. To invoke the service and get a SOAP response, enter: http://localhost:8080/axis2/services/


HelloWorldService/sayHello.

You might also like