Appendix: Using the Pattern Code

The book's sample code is available from two locations. First, the Downloads section of the Apress Web site contains the source code as presented in the book, with some minor enhancements for copyright information, comments, and any necessary updates and corrections ( Second, SourceForge contains an active open -source project for adding Web Service patterns and enterprise application patterns to the P.T. Monday Coffee Company application ( The SourceForge code attempts to maintain currency with software packages and new ideas in the Web Service community. As such, you may find that SourceForge's version of the code is substantially different from the book's code. However, an original version of the code and documentation for the evolution of the code are available.

When using Web Services, a variety of software packages are necessary to support both the Web Service architecture and the architecture adapters in whatever language you are using. This appendix walks you through installing, building, and running the pattern examples.

Installing the Environment

First, you need to download and install the required software as identified in Table A-1. For each download, record the location where you installed it (you will use this information later). Table A-1 gives sample installation directories for each product so that you can see any additional changes that are required in the build and run scripts.

Table A-1: Required Software






Java 2 Standard Edition

Version 1.4.1


The Java 2 Standard Edition from Sun Microsystems. Usually, simply having a version above the version listed here is sufficient.

Pattern code

1.0 or


This is the source code discussed throughout the book along with any constructed files, such as Web Services Description Language (WSDL) files, Web Service Deployment Descriptor (WSDD) files, and property files.

Apache Ant



Ant is the build and execution environment for this book. It makes customization of the environment easier than using script files.

Apache Axis



This is the Web Service engine. ApacheAxis is an open-source project that you can participate in; however, binaries are available from the Web site.

Apache SOAP



This package contains parsing code for Simple Object Access Protocol (SOAP) messages, a prerequisite for the chapters that manipulate SOAP directly.




UDDI4J is a Java-based open-source Universal Description, Data, and Discovery (UDDI) implementation for interacting with UDDI directories. Several chapters rely on UDDI interactions for the sample implementation.

Apache Tomcat


/Program Files/Apache Group/Tomcat 4.1

This is an open-source Java-based Web environment into which Apache Axis plugs. Apache Tomcat versions change rapidly , so be careful about recording the directory that Tomcat installs to and downloading the proper executable binary file. For Windows, you want one labeled something like jakarta-tomcat-4.1.exe.


1.3 Build 5


LiDO is a Java Data Objects (JDO) implementation available as a community edition from LIBeLIS. This is the only software in the book that does not adhere to my open-source mantra. I use it in the book because the company offers a free community edition and has friendly and accessible customer support. There is an open-source counterpart to JDO, but it is currently too complex, especially because JDO is not the primary focus of this book.

MySQL (database)



This is an open-source database used for data persistence.

Connector/J (JDBC)


/java/mm.mysql “2.0.14

This is the JDBC connection for the MySQL database; again, this is open source.

After installing the software, you have to modify a series of property files and BAT files used for compiling the examples and running the examples. All of the settings reside in the /java/WebServicesBook/bin/ file. Check all of the paths identified in the file to ensure that the paths, ports, and addresses match your own. Often, updated versions of the code will change the path to the code. As long as you update the file appropriately, you should be OK ( assuming the product does not break version compatibility). The latest information is available from the SourceForge Web site.

Next, check the ant.bat file in the /java/WebServicesBook/bin directory for the correct settings of the ANT_HOME and JAVA_HOME variables. You may also want to customize this script for your own environment depending on the environment variables set in your global or system environment variables . Once you have fixed the ant.bat file, you can validate that it is working by typing ant from the command line while you are in the /java/WebServicesBook/bin directory. You should receive a list of build targets that match those discussed in this appendix and in the chapter sections that identify Ant targets for the various patterns.

Web Service Patterns
Web Services Patterns: Java Edition
ISBN: 1590590848
EAN: 2147483647
Year: 2003
Pages: 190

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: