apache > ws.apache
Pubscribe
 

Getting Started with Apache Pubscribe

Introduction

The topics in this section detail how to install Apache Pubscribe 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 Pubscribe. It highlights the most common procedures that are used to implement Web Services Notification (WSN). The tutorial also includes steps for deploying Apache Pubscribe.

Lastly, refer to the Developer Guide for basic and advanced tasks as well as general information about Apache Pubscribe. Much of the information that is covered in the demonstration and the tutorial is discussed in more detail in the Developer Guide.

Note
Pubscribe is tightly integrated with Apache WSRF as its WSRF foundation. While it is not required, it is a good idea to start with Apache WSRF. You should also consult the Apache WSRF documentation while completing the instructions in this documentation. All of the tasks required in Apache WSRF are also applicable in Pubscribe.

Installation

Apache Pubscribe 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 WSN family of specifications. Since WSN builds on WSRF, the Web application also includes Apache WSRF.

To run and install Apache Pubscribe, 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 Pubscribe:

  1. Download the Apache Pubscribe binary distribution.
  2. Unzip the distribution to a location on your computer. This location is referred to as INSTALL_DIR.
  3. From INSTALL_DIR, copy the webapps/pubscribe directory to TOMCAT_HOME/webapps.
  4. Start Tomcat.
  5. Using a browser, go to http://localhost:8080/pubscribe. The Apache Pubscribe welcome page displays.
  6. Click View. The list of deployed Web services displays. Three services are deployed: SubscriptionManager, AdminService, and Version. The AdminService and Version services are default Apache-Axis services. The SubscriptionManager is used to pause, resume, destroy, or update subscriptions.
  7. 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 Pubscribe. The demo uses an example that is included in the distribution. The example represents a UNIX file system resource whose management capabilities are exposed as a WSRF-compliant Web service and includes a notification producer used to subscribe to events.

Note
The tutorial provides a step-by-step approach for implementing notifications for WSRF-based resources. In essence, the tutorial builds and deploys the example that is used in this demo.

Complete the following steps:

  1. Using a text editor, open INSTALL_DIR/examples/filesystem/build.properties.
  2. Change the pubscribe.webapp.dir property and set it to the location where the Pubscribe Web application is installed. If you are using Tomcat and have CATALINA_HOME set, you do not need to modify this property.
  3. Uncomment and modify the proxy settings if you require a proxy to connect to external Web sites.
  4. Save and close build.properties.
  5. Open a command prompt and change directories to INSTALL_DIR/examples/filesystem.
  6. Run the following command:

    ant compile deploy

  7. Start Tomcat. If Tomcat is already started, you must restart it.
  8. Using a browser, go to http://localhost:8080/pubscribe/services and verify that the filesystem service is deployed.
  9. From a command prompt change directories to INSTALL_DIR/examples/filesystem directory. An ANT-based SOAP client that is included in the distribution is used to send a SOAP request to the filesystem Web service.
  10. Subscribe to a Notification Topic:

    In this step, a request is sent to subscribe to the notification topic for the MountPointDirectory resource property of the UNIX file system resource.

     ant -f soapclient.xml -Durl=http://localhost:8080/pubscribe/services/filesystem -Dxml=requests/Subscribe_updateMountPointProp.soap
    Note
    To complete step 13 later in this demonstration, you must copy the ResourceIdentifier value that is returned in the SOAP body of the response for this request. This is the look up key for the subscription.

  11. Cause an Event:

    In this step, the MountPointDirectory resource property is changed. This will cause a notification to be published.

     ant -f soapclient.xml -Durl=http://localhost:8080/pubscribe/services/filesystem -Dxml=requests/SetResourceProperties_updateMountPointProp.soap
  12. View Notification:

    In this step, we will retrieve the notification that was published when the MountPointDirectory resource property was changed in the previous step.

     ant -f soapclient.xml -Durl=http://localhost:8080/pubscribe/services/filesystem -Dxml=requests/GetCurrentMessage.soap
  13. Destroy Subscription:

    In this step, a request is sent to destroy the notification topic subscription. Before completing this step, open the requests/Destroy_Subscription.soap file and update the sub:ResourceIdentifier element with the value that was copied in step 10. Save and close the file.

     ant -f soapclient.xml -Durl=http://localhost:8080/pubscribe/services/SubscriptionManager -Dxml=requests/Destroy_Subscription.soap