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 (http://www.apress.com). 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 (http://sourceforge.net/projects/websvcdsnptn/). 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

SOFTWARE

VERSION

DOWNLOAD URL

INSTALLATION DIRECTORY

DESCRIPTION

Java 2 Standard Edition

Version 1.4.1

http://java.sun.com/j2se/downloads.html

/j2sdk1.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

http://www.apress.com/download.html or http://sourceforge.net/projects/websvcdsnptn/

/java/WebServicesBook

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

1.5

http://jakarta.apache.org/ant

/java/jakarta-ant-1.5

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

Apache Axis

1.0

http://xml.apache.org/axis

/java/xml-axis-1_0

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

2.3.1

http://xml.apache.org/soap

/java/soap-2_3_1

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

UDDI4J

1.0.3

http://www.uddi4j.org

/java/uddi4j

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

4.1

http://jakarta.apache.org/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.

LIBeLIS LiDO (JDO)

1.3 Build 5

http://www.libelis.co

/dev/lido

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)

3.23.52

http://www.mysql.org

/mysql

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

Connector/J (JDBC)

2.0.14

http://www.mysql.org

/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/build.properties 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 build.properties 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

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net