Sun Java Solaris Communities My SDN Account Join SDN
 
Article

An Example Tutorial for JAX-RPC Packaging Tool (Version 1.0)

August 4, 2003  

This document describes how to use Java API for XML-Based Remote Procedure Calls (JAX-RPC) Packaging Tool to create a deployable Web archive (WAR) module for Web services from the sample application that's included in Sun ONE Application Server 7.

  1. Copy the webservice.jar file into the lib directory.

    The default lib locations are shown below:

    On the Solaris Operating System (OS): /usr/sfw/lib/ant
    On Windows: C:\Sun\AppServer7\lib\ant\lib
    On Linux /opt/SUNWappserver7/lib/ant/lib
  2. Edit the build.xml file in the appserver-install_directory/samples/webservices/jaxrpc/simple/src directory and specify the task definition by adding this line:

    <taskdef name="wsgenerator" classname="webservicegen" />

  3. Specify the task in your build.xml file by adding the following:

    <target name="webservice-generator">

        <wsgenerator  srcdir="." destdir="../build" Sunonehome="../../../../../" >

            <endpoint name="Helloworld" interface="samples.webservices.jaxrpc.simple.HelloIF" implementation="samples.webservices.jaxrpc.simple.HelloImpl" mappingUrlPattern="helloservice"/>

       </wsgenerator>

     <sun-appserv-deploy
         file="../build/webservice.war"
         name="simpleapp"
         type="web"
         contextroot="simple"
         force="true"
         precompilejsp="false"
         verify="false"
         upload="true"
         user="admin"
         password="admin123"
         host="astserver.india.sun.com"
         port="4848"
         instance="server1"
         sunonehome="../../../../../" />

      </target>

  4. Execute the target by typing:

    appserver_home/bin/asant webservice-generator

    where appserver_home is the directory in which Sun ONE Application Server 7 is installed.

    Subsequently, JAX-RPC Packaging Tool creates a WAR module on Sun ONE Application Server 7.

To verify whether the deployment is successful and whether the program is running, go to:
http://hostname:port_number/simple/helloservice

Here is an example of the output:

Port Status Information
Helloworld ACTIVE
Address: http://yourserver.com:80/simple/hellowebservice
WSDL: http://yourserver.com:80/simple/hellowebservice?WSDL
Port name: {http://webservices.com/wsdl/Helloworld}HelloIFPort
Remote interface: samples.webservices.jaxrpc.simple.HelloIF
Implementation class: samples.webservices.jaxrpc.simple.HelloImpl
Model: http://yourserver.com:80/simple/hellowebservice?model