Getting Started with Apache WSRF
Introduction
The topics in this section detail how to install Apache WSRF and use the quick demonstration to verify the installation as well as exercise some of the features that are included in the release. It is suggested that you complete these sections before starting any development work. Once you get a good feel for the example in the demonstration, you can recreate it by completing the tutorial.
The tutorial takes a step-by-step approach to learning Apache WSRF. It highlights the most common procedures that are used to create WSRF-compliant Web services for resources. The tutorial also includes steps for deploying Apache WSRF Web services.
Lastly, refer to the Developer Guide for basic and advanced tasks as well as general information about Apache WSRF. In addition, much of the information that is covered in the demonstration and the tutorial is discussed in more detail in the Developer Guide.
Installation
Apache WSRF is packaged as a Web application. In particular, it is an Apache Axis-based Web application with additional functionality that is required to implement the WSRF family of specifications.
To run and install Apache WSRF, you must first:
- install Apache Tomcat or a similar Web container. The documentation assumes Tomcat and refers to the Tomcat home directory (e.g., c:\jakarta-tomcat-4.1.30) as TOMCAT_HOME. In addition, it is assumed that Tomcat is configured to listen at the default HTTP port (8080).
- install Apache Ant 1.6.X and include its bin directory in the PATH environment variable. Set an ANT_HOME environment variable to the Ant installation directory.
To install Apache WSRF:
- Download the Apache WSRF binary distribution.
- Unzip the Apache WSRF distribution to a location on your computer. This location is referred to as INSTALL_DIR.
- From INSTALL_DIR, copy the webapps/wsrf directory to TOMCAT_HOME/webapps.
- Start Tomcat. If Tomcat is already started, you must restart it.
- Using a browser, go to http://localhost:8080/wsrf. The Apache WSRF welcome page displays.
- Click View. The list of deployed Web services displays. Two services are deployed: AdminService, and Version. The AdminService and Version services are default Apache-Axis services.
- Click on the respective WSDL links to view and ensure that the WSDL for the services are published.
Quick Demonstration
The Quick Demonstration shows some of the features and implementation details of Apache WSRF. The demo uses an example that is included in the distribution (INSTALL_DIR/examples/filesystem). The example represents a UNIX file system resource whose management capabilities are exposed as a WSRF-compliant Web service.
Complete the following steps:
- Using a text editor, open INSTALL_DIR/examples/filesystem/build.properties.
- Change the wsrf.webapp.dir property and set it to the location where the Apache WSRF Web application is installed. If you are using Tomcat and have CATALINA_HOME set, you do not need to modify this property.
- Uncomment and modify the proxy settings if you require a proxy to connect to external Web sites.
- Save and close build.properties.
- Open a command prompt and change directories to INSTALL_DIR/examples/filesystem.
- Run the following command:
ant compile deploy
- Start Tomcat, or restart it if it is already started.
- Using a browser, go to http://localhost:8080/wsrf/services and verify that the filesystem service is deployed.
- In this step, an Ant-based SOAP client that is included in the distribution is used to send a SOAP request to the filesystem Web service.
The request uses the GetMultipleResourceProperties operation to return a list of resource properties for the filesystem
resource. From a command prompt change directories to INSTALL_DIR/examples/filesystem directory and run the
following command:
ant -f soapclient.xml -Durl=http://localhost:8080/wsrf/services/filesystem -Dxml=requests/GetMultipleResourceProperties.soap
You may also try other request messages in the requests sub-directory.