You can use the
<JWSDP_HOME>/jwsdp-shared/bin/webserviceclient.xml
template build file to help you build your web service 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.1 2005Q2 Update 2. If you performed a "Custom" installation, not all of the required JAR files were installed. If the
webserviceclient.xml
buildfile cannot locate these JAR files, it may not execute properly.To execute these instructions, first change to the
<JWSDP_HOME>/jwsdp-shared/bin
directory.
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.6 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.6 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.
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 ofthe 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.
Copy the
webserviceclient.xml
andclient-config.xml
files from<JWSDP_HOME>/jwsdp-shared/bin
to the top-level directory of your client code. Copy thewebserviceclient.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 asconfigfile
inwebserviceclient.props
. This XML file contains the information needed by the JAX-RPCwscompile
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.xmlThedefault target for the build file is
dist
. This target creates the clientdistribution JAR file in thedist.dir
directory defined inwebserviceclient.props
.
Please send feedback on the Java Web Services Developer Pack to users@jwsdp.dev.java.net.
Copyright © 2005 Sun Microsystems, Inc. All rights reserved.