In my previous post I presented a simple technique to create technical web service designs. I touched on the tools and the process and provided some code examples with guidelines. In this entry I will run through a procedure to establish a simple environment where you will be able to create your own designs. At the end you should be able to run the ant command to produce all of the design artifacts for a basic web service design project.
1. Software Requirements
- Apache CXF 2.3.7
- Apache Xalan-j 2.7.0
- Apache Ant 1.6.5
- Apache XMLBeans 2.4.0
- Java Toolbox Framework Build 29
Make use of section 1 and 2 of the Java Toolbox Framework Installation Guide to complete the installation. You will only require the software listed above to successfully make use of the web service design tool chain. Find below an example configuration that I employ on my unix based system:
/opt/frameworks/toolbox /opt/asf/cxf23 /opt/asf/xmlbeans /opt/asf/xalan-j /opt/asf/ant
TOOLBOX_HOME=/opt/frameworks/toolbox TOOLBOX_CXF_HOME=/opt/asf/cxf23 TOOLBOX_XALAN_HOME=/opt/asf/xalan-j TOOLBOX_XMLBEANS_HOME=/opt/asf/xmlbeans
Also make sure that the ant command is available on the PATH.
3. Using the Example Project
The Java Toolbox Framework, installed as part of the previous step, contains a very simple example or skeleton project (or source directory) that can be copied and customised to suite your needs. The provided source directory has the following structure:
|File or Directory||Description|
|build.properties||The top level Ant properties file containing configuration parameters for WSDL generation|
|build.xml||The top level Ant build file responsible for generating WSDL documents|
|doc||Directory containing all of the generated design artifacts. The contents of this
directory can be made available on a web server for online access.
|java||Directory containing the Java sources for all service interfaces. Also contains the
compiled interfaces as well as the compiled XMLBeans generated API.
|java/build.properties||The Ant properties file containing configuration parameters for the Java build process.|
|java/build.xml||The Ant build file responsible for compiling the Java sources and generating the documentation for all service interfaces.|
|wsdl||Directory containing the generated WSDL documents.|
|xsd||Directory containing the XSD documents that define the data model employed by service interfaces.|
|xsd/build.properties||The Ant properties file containing configuration parameters for the XMLBeans build process.|
|xsd/build.xml||The Ant build file responsible for generating the XMLBeans API and generating the data model documentation.|
Perform the following steps to create the design artifacts for the example source directory:
- Create a working directory in an appropriate location:
- Copy the contents of the example project to the working directory:
cp -rv $TOOLBOX_HOME/templates/misc/wsdesign/* ~/src/myservices
- Compile the source and generate the design artifacts:
cd ~/src/myservices cd xsd ant # Build the XMLBeans API and generate the data model documentation. cd ../java ant # Build the service interface and generate the service documentation. cd ../ ant # Generate the WSDL
The doc directory should contain all of the generated design artifacts and can be viewed by accessing the doc/servicedoc/index.html page in a browser.
You can now start modifying and creating your own service designs.
- * The tool chain will in all likelihood work with later versions of the relevant Apache projects. The listed packages are the ones I am currently using. Also note that you would need the graphviz tools installed to generate UML diagrams for the XMLBeans generated API and the service interfaces.