Developing Web Services Server and Client Code using Apache Axis
Before you start on this assignment, you must copy ~raj/.cshrc file once again
into your home directory. This contains new environmental variables that
are required for using Apache Axis.
Developing Server Code and Deploying the Services
- cd ~/8711
- mkdir axis
- cd axis
- mkdir calc
- cd calc
- Write the Java Web Service; A sample Java class Calculator with two public
methods add and subtract can be copied as: cp ~raj/axis/calc/Calculator.java .
- Compile the program: cd ..; javac calc/Calculator.java
- Write deployment file; Sample deployment file can be copied as:
cp ~raj/axis/calc/deploy.wsdd calc/
- Run simple Axis server in a separate window:
cd ~/8711/axis/
java org.apache.axis.transport.http.SimpleAxisServer -p 15001
Note: Please use the port assigned to you.
- Deploy the service:
java org.apache.axis.client.AdminClient -p 15001 calc/deploy.wsdd
- Check if service is deployed:
http://tinman.cs.gsu.edu:15001/axis/services/
You should be able to see the service and the methods of the service and a link
to the WSDL file of the service.
Developing Client Code
- cd ~/8711/axis
- Write client code; Sample client code can be copied as:
cp ~raj/axis/calc/calcClient.java calc/
- Compile: javac calc/calcClient.java
- Run the client: java calc.calcClient -p 15001 add 4 5
You should see result of 9.
Port Assignments
| Ahmed | 15001 |
| Chen | 15002 |
| Dubuisson | 15003 |
| He | 15004 |
| Jung | 15005 |
| Kalgaonkar | 15006 |
| Liu | 15007 |
| Mukker | 15008 |
| Nguyen | 15009 |
| Padhye | 15010 |
| Panaganti | 15011 |
| Supaneedis | 15012 |
| Syeda | 15013 |
| Vo | 15014 |
| Yang | 15015 |
| Zheng | 15016 |
| Zhuang | 15017 |
Please do not keep server running when you are done; You may kill the server
with CTRL-C.