Sloan Digital Sky Survey
Astronomical Data Query Language >> Creating a new Java Web service

Creating a new Java Web Service

Let us now look at how we create a new Java web service. You can either start by generating code on your machine or you can use the already generated code provided in the Download Code section.

Requirements

Code Generation

  1. First, let us download the latest ADQL webservice wsdl file into a local file Archive.wsdl.
  2. Next Run java org.apache.axis.wsdl.WSDL2Java -s -v Archive.wsdl on the command line. This generates the skeleton web service, ArchiveSoapImpl.java file in the /net/ivoa/voql folder.
  3. Write your implementation inside this file for the different methods of the ADQL web service.
  4. Compile all the java files into a single ArchiveWS.jar file.

Download Code

You can download the entire source code in a zip format over here. This includes the WSDL file, the generated java files, deployment files {deploy.wsdd and undeploy.wsdd}, the ArchiveWS.jar file and build.xml file. Once you have tested the deployment of this code, feel free to change the implementation of the web service in ArchiveSoapImpl.java file based on your needs.
Here is some help on the ant build file.
Run ant Generate to generate the java files, ant to compile the code, ant Compress to generate the jar file.

Deployment

  1. Have Resin installed on the webserver.
  2. Have Axis configured for Resin. { This is simple, Once you install resin, just copy \webapps\axis folder in the axis installation to the \webapps\axis folder of Resin installation}.
  3. Create a new directory ArchiveWS under the \webapps\axis\WEB-INF folder.
  4. Copy the generated deploy.wsdd and undeploy.wsdd files into the \webapps\axis\WEB-INF\ ArchiveWS folder.
  5. Copy the generated ArchiveWS.jar file onto the \webapps\axis\WEB-INF\lib folder of the resin installation.
  6. Run java org.apache.axis.client.AdminClient -p8090 list. This will list all the web services registered under Resin.
  7. Now, from the \webapps\axis\WEB-INF\classes folder, Run java org.apache.axis.client.AdminClient -p8090 deploy.wsdd
  8. Now, Run java org.apache.axis.client.AdminClient -p8090 list. This will list all the web services registered under Resin. You should see your web service also listed here.
  9. Later, when you want to remove the web service, Run java org.apache.axis.client.AdminClient -p8090 undeploy.wsdd
  10. Check for proper deployment of the web service using the http://localhost:8090/axis/services/ArchiveSoap?wsdl


Vivek Haridas
Last Modified :Friday, July 25, 2003 at 3:34:45 PM , $Revision 1.1 $