The deegree Web Feature Service offers numerous configuration options that enable the adjustment to different data sources, data types and server environments. The configuration will be handled through the adjustment of several XML files.
The web interface of the WFS is realized as Java servlet. So in addition to the configuration of the service itself the integration of the servlet into a web service will be necessary. Most web servers in use support Java servlet technology. Therefore the usage is not limited to one specific server. Because of its wide spreading usage and being an open source project we will describe the integration into the Apache Tomcat (4.x) servlet engine.
deegree WFS can be downloaded from http://www.deegree.org/demo. After downloading the archive has to be unpacked. Use the following directories e.g.:
Table 1. Installation directories
| Linux: | /home/deegreewfs/ or /opt/deegreewfs/ or /usr/local/deegreewfs |
| Windows: | C:\deegreewfs\ |
In the remainder of this document, the directory you extracted the files to is referred to as $deegreewfs_home.
deegree WFS requires the following libraries:
Table 2. required libraries
| Library | Explanation |
|---|---|
| mlibwrapper_jai.jar | Java Advanced Imaging (raster-data processing) |
| jai_core.jar | Java Advanced Imaging (raster image processing) |
| jai_codec.jar | Java Advanced Imaging (raster image processing) |
| jaxp_api.jar | Part of the sun xml-implementation |
| xalan.jar | SAX-Parser |
| sax.jar | Part of the sun xml-implementation |
| xercesImpl.jar | Apache xml-implementation |
| xsltc.jar | Sun xslt-processor |
| deegree.jar | deegree WFS |
| j3dcore.jar | part of the Java 3D API (needed to create coordinate reference systems) |
| j3dutils.jar | part of the Java 3D API (needed to create coordinate reference systems) |
| vecmath.jar | part of the Java 3D API (needed to create coordinate reference systems) |
If a database connection through a JDBC driver is used as source for the geo data an additional library containing this driver is needed.
Furthermore the following configuration file is needed:
Table 3. configuration files
| Configuration file | Explanation |
|---|---|
| wfs_capabilities.xml | capabilities document of the WFS (the name is not mandatory) |
For each data source / feature type to be integrated into the WFS a XML file describing it is needed.
The web server (we use Apache Tomcat 4.0.3) must be notified where it can find the required libraries and the deegree WFS capabilities document.
First, the Tomcat must be notified, where the root directory of the WFS is located. Therefore the following entry has to inserted into the file server.xml which is located in the conf directory of the Tomcat installation:
<Service>
<Engine>
<Host>
...
<Context path="/deegreewfs"
docBase="$deegreewfs_home/webspace"
crossContext="false"
debug="0"
reloadable="false" >
</Context>
</Host>
</Engine>
</Service>
The attribute 'path' indicates to which path the physical path of the root directory will be mapped. At the example the WFS will be callable through http://www.oneURL.de/deegreewfs/... The other attributes should not be changed. Their exact meaning is described in the Tomcat documentation.
The name of the root directory can be selected freely. Within the root directory the Tomcat expects compellingly a directory with the name WEB-INF. Within the WEB-INF directory the deployment descriptor (web.xml) is located, which is evaluated by Tomcat in order to determine, which servlets belong to the application, under which names they should be available, which parameters are handed over to the servlets and which access restrictions exist.
Furthermore for the start-up of deegree WFS the following entries are to be made in the file web.xml, which has to be in the directory %docBase%/WEB INF
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<servlet>
<servlet-name>wfs</servlet-name>
<servlet-class>
org.deegree_impl.enterprise.WFSServlet
</servlet-class>
<init-param>
<param-name>capabilities</param-name>
<param-value>
$deegreewfs_home/xml/wfs_capabilities.xml
</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>wfs</servlet-name>
<url-pattern>/wfs</url-pattern>
</servlet-mapping>
</web-app>
Within the <servlet> element the name of the servlet and the Java class, which represents the servlet, is indicated first. The name of the servlet can be selected freely. The servlet is included within the library deegree.jar.
With the help of the element <init-param> a parameter is handed over to the servlet, which will be evaluated during its initialisation. This parameter describes the position of the capabilities document. The name of the parameter (capabilities) is compelling, the name and the position of the capabilities of document can be selected freely.
Using the element <servlet-mapping> the point, where the servlet is accessible is specified. In contrast to the shown example the servlet name and <url-pattern>, i.e. the name on that the servlet name will be mapped to, do not have to be identical. Together with the entry in server.xml represented above the WFS in the example is accessible through:
http://www.oneURL.de/deegreewfs/wfs?version=1.0.0&request=GetFeature