We first look at the easiest way in Axis of providing a Web Service.
First, produce a Java class declaration containing the methods that you wish to be made available. For example, we could produce:
0210: public class Convert { 0211: public double toFahrenheit(double pCentigrade) { 0212: return 32 + pCentigrade*9/5; 0213: } 0214: }Store this text in a file with a .jws extension. In the above example, the text would be stored in a file called Convert.jws.
Put this file in the directory:
%CATALINA_HOME%\webapps\axisAnd that's it! You have a Web Service available at:
There is a Web Service here Click to see the WSDLIf you do click on Click to see the WSDL, your browser will go to:
Having provided a Web Service, you can now follow the steps given earlier if you want to provide a client that accesses this Web Service.
The Axis User's Guide says ‘JWS web services are intended for simple web services. You cannot use packages in the pages, and as the code is compiled at run time you can not find out about errors until after deployment’. The Axis User's Guide gives details of alternative ways of deploying Web Services which it says should be used for ‘production quality web services’.