Web Services Eventing (WS-Eventing) Primer

W3C Working Draft 21 October 2010

Editor:
Gilbert Pilz, Oracle

Abstract

The Web Services Eventing Primer is an introductory description of the Web Services Eventing [WS-Eventing] specification. This document describes the intended useage of the specification via examples, illustrations, and non-normative prose. The associated WS-Eventing provides the complete, normative description of the Web Services Eventing specification.

Status of this Document

This document is an editors' copy that has no official standing.

Table of Contents

1 Introduction
2 Yet Another Eventing Spec
3 Actors
   3.1 Subscriber
   3.2 Event Sink
   3.3 Event Source
   3.4 Subscription Manager
4 Subscriptions and their Properties
   4.1 Identity
   4.2 Lifecycle States
   4.3 Delivery Mechanism
   4.4 Notification Format
        4.4.1 Wrapped Notifications
        4.4.2 Unwrapped Notifications
   4.5 Expiration
   4.6 Filters
   4.7 SubscriptionEnd
5 Metadata
   5.1 EventSource Assertion
   5.2 SubscriptionManager Assertion
6 Describing Events
   6.1 Notifications and Service Descriptions
   6.2 Event Descriptions
   6.3 Notification WSDLs
7 Addiing QoS to Notifications
   7.1 Use Cases
   7.2 Indicating Desired Qos
   7.3 Advertising Supported QoS

Appendices

A Referencces
   A.1 Normative References
   A.2 Informative References
B Change Log


1 Introduction

This document, Web Services Eventing Primer, provides an introductory description of the Web Services Eventing protocol and should be read alongside the formal description contained in the WS-Eventing [WS-Eventing] specification.

This non-normative primer describes when and how the WS-Eventing specification might be used by applications that require a standard mechanism for subscribing to a series of notifications about a set of external events.

This document assumes a basic understanding of XML 1.0, Namespaces in XML, WSDL 1.1 and SOAP.

This document begins by describing WS-Eventing usage scenarios and actors. Subsequent sections introduce the features of the WS-Eventing protocol and describes these features in the context of concrete examples.

2 Yet Another Eventing Spec

If there is one thing that most readers can probably agree on, it is that the IT industry does not need yet another pub/sub specification. Multiple, mature queuing and publish/subscribe technologies have existed in the marketplace for some time. Each of these technologies has their strengths and weaknesses, their suitability to particular domains, and a significant body of architectural, developmental and operational experience behind them. So what is the point of WS-Eventing?

Like many popular concepts in IT, the terms "pub/sub", "eventing", etc. have many different meanings, each with its own context. One aspect of the term "eventing" is its sense as a programming design pattern (also referred to, more formally, as "the Observer pattern" [Observer]). Essentially, WS-Eventing describes an interoperable implementation of the eventing design pattern using SOAP-based messaging technologies. It is primarily a SOAP specification, and secondarily an eventing specification. The design of WS-Eventing does not seek to break new ground in terms of functionality, performance, or flexibility. Rather it allows those who choose to use SOAP-based technologies access to a standard, interoperable API for implementing a popular and useful design pattern.

You might consider using WS-Eventing if one or more of the following applies to you:

You might consider using something other than WS-Eventing if one or more of the following applies to you:

3 Actors

The following figure is a block diagram of the main actors in WS-Eventing. The individual boxes represent logical components, not physically deployed entities. The location and organization of these components has been purposely left unconstrained by WS-Eventing. So, for example, it is possible for the Event Source and the Subscription Manager to co-reside within the same process. Nevertheless, from the perspective of the specification and for the purposes of this primer, these components are regarded as separate entities.

WS-Eventing Actors

4 Subscriptions and their Properties

A Subscription is an agreement between the Subscriber and the Event Source/Subscription Manager to affect the transmission of Notifications to the Event Sink. This agreement is binding for the lifetime of the Subscription. The behavior and nature of the Subscription are affected by the properties described below.

4.1 Identity

Unlike specifications such as WS-ReliableMessaging [WS-ReliableMessaging], WS-Eventing does not identify Subscriptions with a discrete element like a "sequence ID" (wsrm:Identifier). Instead it uses the wse:SubscriptionManager endpoint reference (EPR). As the spec states, this EPR is "the EPR of the Subscription Manager for this Subscription" but, in this case, it is useful to keep in mind that every Subscription has its own, logical Subscription Manager. While it is true that all the Subscription Managers created by a Event Source may share certain characteristics (i.e. their endpoint URI) and code, nevertheless they are separate, logical entities.

The following are some examples of Subscription Manager EPRs.

<wse:SubscriptionManager>
  <wsa:Address>
    http://www.example.org/cetatrack/SubscriptionManager?id=28
  </wsa:Address>
</wse:SubscriptionManager>

In the above example the EPR is "made unique" via the use of a query string in the wsa:Address URI.

<wse:SubscriptionManager>
  <wsa:Address>
    http://www.example.org/cetatrack/SubscriptionManager
  </wsa:Address>
  <wsa:ReferenceParameters>
    <ctx:id>28</ctx:id>
  </wsa:ReferenceParameters>
</wse:SubscriptionManager>

In the above example the EPR is made unique via the use of a "ctx:id" element as a reference parameter.

Either of these techniques, in addition to others not covered here, are valid mechanisms for identifying the Subscription and its Manager. Note that the semantics defined by WS-Addressing prevent the Subscriber from infering anything about the "id" of the Subscription (for example, that its value is "28"). Instead the Subscriber must simply treat the wse:SubscriptionManager EPR as an opaque reference in any future GetStatus, Renew, or Unsubscribe requests.

As we will see next section, the fact that a Subscription is identified by an EPR that references its Subscription Manager has some interesting consequences in the area of Subscription lifecycle management.

4.3 Delivery Mechanism

One of the key extension points of the WS-Eventing spec is the notion of the Delivery Mechanism. A Delivery Mechanism defines how Notifications are conveyed from their source to the Event Sink. The intent of this extension point is to allow implementations to extend WS-Eventing to support other, possibly non-SOAP based, transmission mechanisms. This extension point could also be used to support brokered Notifications.

The WS-Eventing spec defines a single Delivery Mechanism in which Notifications are transmitted as SOAP messages in a one-way exchange pattern. The key attribute of this Delivery Mechanism is the wse:NotifyTo EPR which references the endpoint to which Notifications are to be transmitted.

It should be noted that the extensibility provided by the Delivery Mechanism and the extensibility provided by the NotifyTo EPR overlap to a degree. A good example of this is the issue of "pulling" Notifications for non-addressable Event Sinks (i.e. Event Sinks that lie behind a firewall or NAT and are therefore unable to accept incoming connections). One choice would be to create a new WS-Eventing Delivery Mechanism that defined a "Pull" request on the Subscription Manager interface, etc. The other choice would be to leverage the extensibility of wse:NotifyTo/wsa:Address to indicate the use of WS-MakeConnection [WS-MakeConnection]. Obviously each implementation has to make its own choices based on its requirements and constraints but it is considered best practice to (a) re-use existing standards when possible and (b) implement the extension at the lowest, common extension point shared by all the components in the interaction.

The Delivery Mechanism and NotifyTo EPR are immutable properties of a Subscription; they are set at Subscribe-time and cannot be changed for the life of the Subscription.

4.4 Notification Format

As described in Section 2.3 of the WS-Eventing specification, the Notification Format defines how Notifications are serialized as messages. WS-Eventing defines two Formats, wrapped and unwrapped.

The Notification Format is an immutable property of a Subscription; it is set at Subscribe-time and cannot be changed for the life of the Subscription.

4.4.1 Wrapped Notifications

As described in the specification, all Wrapped Notifications have the wse:Notify element as the first/only child of the soap:Body element. The following is an example of a Wrapped Notification:

A few things to note about the above example: The event-specific information is "wrapped" in the wse:Notify element in lines 09-18. The wsa:Action value in line 04 is the same for all Wrapped Notifications. The @actionURI value in line 09 provides information that allows the Event Sink dispatch this particular Notification to code that has some knoweldge/expectation about its structure and contents.

The use of Wrapped Notifications allows an application to implement a single Event Sink that is capable of receiving any Wrapped Notification regardless of its originating Subscription or the structure of the event information contained within it. An example of where this is useful would be a logging Event System that simply records Notifications without attempting to process them in any semantically meaningful way.

The problem with Wrapped Notifications is that, if you process the WSDL in Appendix D of the WS-Eventing specification with common WSDL processing tools, the generated stubs will be very generic in nature. Any event-specific marshalling code will either need to be written by hand or generated using some other, presumably schema-based, code generation tool. This undercuts many of the motivations outlined in Section 2 of this primer.

5 Metadata

6 Describing Events

7 Addiing QoS to Notifications

A Referencces

A.1 Normative References

WS-Eventing
W3C Working Group Draft, "Web Services Eventing (WS-Eventing)" , D. Davis, et al., Editors. World Wide Web Consortium (W3C), 05 August 2010. Available at http://www.w3.org/TR/ws-eventing.
SOAP Part 1
SOAP Version 1.2 Part 1: Messaging Framework (Second Edition) , Martin Gudgin, Marc Hadley, Noah Mendelsohn, Jean-Jacques Moreau, Henrik Frystyk Nielsen, Anish Karmarkar, Yves Lafon, Editors. World Wide Web Consortium, 27 April 2007. Available at http://www.w3.org/TR/2007/REC-soap12-part1-20070427/.

A.2 Informative References

Observer
Wikipedia, "Observer pattern" , Wikipedia, The Free Encyclopedia, 7 September 2010. Available at http://en.wikipedia.org/wiki/Observer_pattern.
WS-MakeConnection
OASIS Standard, "Web Services Make Connection (WS-MakeConnection) Version 1.1" , D. Davis, et al., Editors. Organization for the Advancement of Structured Information Standards (OASIS), 02 February 2009. Available at http://docs.oasis-open.org/ws-rx/wsmc/200702.
WS-ReliableMessaging
OASIS Standard, "Web Services Reliable Messaging (WS-ReliableMessaging) Version 1.2" , D. Davis, et al., Editors. Organization for the Advancement of Structured Information Standards (OASIS), 02 February 2009. Available at http://docs.oasis-open.org/ws-rx/wsrm/200702.

B Change Log

Data Author Description
2010-10-18 GP Initial revision
2010-10-21 GP Wrote Section 3, "Actors". Added block diagram of Actors.
2010-11-16 GP Sections 4.1 - 4.4.