Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
4.3 Implementation in Java<br />
As already mentioned, we will discuss only the JWSDP 1.5 framework. The preparations described in<br />
section 2.2 must have been completed. Here, too, the first step is to generate the proxy classes. The Sun<br />
documentation is usually based on the assumption that one wants to publish a web service and therefore<br />
they require the installation of a web container such as Tomcat. In our case, we really only need the client<br />
and there is thus no need for an application server or web container.<br />
The generation of client proxy classes using WS-Security extensions is not well documented. Therefore, we<br />
recommend that you take the enclosed configuration files and edit them.<br />
First of all, the webserviceclient.props file has to be edited. Values must be assigned to all parameters<br />
except the proxy information. The meanings of the individual parameters can be taken from the<br />
comments in Fig 1.<br />
# place where Java is installed<br />
javahome=C:/Java/2sdk1.4.2_07<br />
# place where JWSDP is installed<br />
jwsdp.home=C:/Java/jwsdp-1.5<br />
# Destination of the generated classes<br />
build.dir=build<br />
# Destination of generated jar File<br />
dist.dir=dist<br />
# Location of the Configuration-File<br />
configfile=config/client-config.xml<br />
# Proxy Server Host if there is one<br />
proxy.host=<br />
# Proxy Server Port if there is a Proxy Server<br />
proxy.port=<br />
# Name of the jar File<br />
jarname=DownloadInvoiceProxy<br />
# Set to true or false to control jaxrpc tool output<br />
jaxrpc.tool.verbose=true<br />
Fig 1: Contents of the webserviceclient.props file<br />
The webserviceclient.xml file is a control file for the ant tool which is included in the JWSDP package. It is<br />
located in \apache-ant\bin. The XML file references the configuration above, assembles<br />
the class path, contains compiler instructions for generating classes and much more. In our case, nothing<br />
has to be changed in this file. We still recommend, however, that you have a look at it in order to<br />
understand the procedure.<br />
Next, the client-config.xml file has to be edited. Here you have to enter the URL of the WSDL file and the<br />
name of the package to be generated.<br />
<br />
<br />
<br />
<br />
Fig 2: Contents of the client-config.xml file<br />
14/19