Developing applications that use WS-Notification

You can code a single application to undertake several WS-Notification tasks. These topics provide sample code for common tasks that your WS-Notification applications can perform.

Before you begin

Most of these examples use the Java™ API for XML-based remote procedure call (JAX-RPC) APIs and WebSphere® Application Server APIs and SPIs. These JAX-RPC examples can interact successfully with Version 6.1 or Version 7.0 WS-Notification service points. However if you want to use WS-Notification with policy sets, for example to enable composition with WS-ReliableMessaging, then your WS-Notification applications must be encoded to use the Java API for XML-based Web Services (JAX-WS) programming model and must interact with Version 7.0 WS-Notification service points. If you are new to programming JAX-WS client applications, see the following topics:

Your applications can also use WS-Notification to receive event notifications generated by other clients of the service integration bus such as JMS clients. This is described in Topology for WS-Notification as an entry or exit point to the service integration bus and Providing access for WS-Notification applications to an existing bus topic space. For information about developing applications for a mixed clients solution, including cross-streaming from a JMS client, see Interacting with JMS message types.

About this task

A single application can be coded to undertake several WS-Notification tasks. Use the examples to help you code these tasks into your WS-Notification applications.

For an overview of how applications can use the notification broker, see WS-Notification: How client applications interact at run time.

WS-Notification applications divide into two broad types: those that expose a Web service endpoint (for example a WS-Notification consumer application that receives notifications of stock valuation changes), and those that do not expose a web service endpoint (for example applications that generate notifications of stock valuation changes). For broad guidance on the steps you take to develop each of these application types, see the following topics:

Rather than receiving all messages on a topic to which you have subscribed, your consuming application can use XML Path (XPath) selectors to filter the messages based upon the contents of each message as described in Filtering the message content of publications.

The code examples listed in this topic use the following WebSphere Application Server APIs and SPIs:

com.ibm.websphere.sib.wsn.AbsoluteOrRelativeTime;
com.ibm.websphere.sib.wsn.CreatePullPoint;
com.ibm.websphere.sib.wsn.CreatePullPointResponse;
com.ibm.websphere.sib.wsn.Filter;
com.ibm.websphere.sib.wsn.GetMessages;
com.ibm.websphere.sib.wsn.GetMessagesResponse;
com.ibm.websphere.sib.wsn.NotificationMessage;
com.ibm.websphere.sib.wsn.TopicExpression;
com.ibm.websphere.webservices.soap.IBMSOAPFactory;
com.ibm.websphere.wsaddressing.EndpointReference;
com.ibm.websphere.wsaddressing.WSAConstants;
com.ibm.wsspi.wsaddressing.EndpointReferenceManager;

Procedure