Integrating Java WSDP Components into the Sun Java System Application
Server Platform Edition 8
Template Build File for Web Service Clients
You can use the
<JWSDP_HOME>/jwsdp-shared/bin/webserviceclient.xml
template build file to help you build your webservice client.
This document explains how to use this Ant build file with various
targets to help you build and set up the classpath for your Web service
client.
Note: You must have performed a "Typical" installation of
Java WSDP (installed all of the components) if you want to use the
installation for integration with the Sun
JavaTM System Application Server
Platform Edition 8. If you performed a
"Custom" installation, not all of the required JAR files were installed.
If the webserviceclient.xml build
file cannot locate these JAR
files, it may not execute properly.
To execute these instructions, first change to the
<JWSDP_HOME>/jwsdp-shared/bin
directory.
Setting Up Your Web Service Client Application to Use Java WSDP 1.4
Components
To set up the classpath environment to build and run your Web service
client, modify the following properties in the
<JWSDP_HOME>/jwsdp-shared/bin/webserviceclient.props
file:
jwsdp.home: The directory where Java WSDP 1.4 is
installed. You do not need to set this field if you are using the
version
of Ant that is part of the Java WSDP 1.4 installation.
build.dir: The directory into which you want the
classes to be compiled.
dist.dir: The
directory where you want the JAR files to
be placed.
src.dir: The
location of the source files.
configfile:
Configuration needed for building the Web
service client. This file
generally has the location of the WSDL file
and also the package name to be
used for the generated source. For an
example, see
<JWSDP_HOME>/jwsdp-shared/bin/config-client.xml.
jarname: Name of
the resulting JAR file.
proxy.host: Name
of the proxy host, if the client uses a
proxy server.
proxy.port: Port
of the proxy server (usually 8080).
Note: You can perform this step for every Web service
client you
write, or you can place a global webserviceclient.props
file
in
your home directory for all Web service clients.
Using the Template File
Copy the webserviceclient.xml and
client-config.xml files from
<JWSDP_HOME>/jwsdp-shared/bin
to the top-level
directory of your client code. Copy the webserviceclient.props
file either to the same directory or to your home directory.
Edit the webserviceclient.props file and fill in the
values described in the preceding section.
Edit the file client-config.xml, which is defined as
configfile in webserviceclient.props. This XML
file contains the
information needed by the JAX-RPC wscompile
tool. Specify the
location of the WSDL definition file and the package
name to be used for the class files that are
generated from the WSDL for
the client.
Run Ant, passing it the webserviceclient.xml file as input.
Use the following command:
ant -f webserviceclient.xml
The
default target for the build file is dist. This target
creates the client
distribution JAR file in the dist.dir
directory defined in webserviceclient.props.
Please send feedback on the Java Web Services Developer Pack to
users@jwsdp.dev.java.net.
Copyright © 2004 Sun Microsystems, Inc. All
rights reserved.
|