- 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 |
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" />
- 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>
- 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 |
|