SOAP  is an object-oriented, Internet based protocol for exchanging information between applications in a distributed environment. The SOAP specification defines the format of data to be in XML. SOAP has the advantage that many programming languages and component frameworks can support it. Since XML is a canonical way of representing data in a tree oriented structure, it lends itself to self-describing and extensible formats. It is to be noted that high performance distributed applications can depend on real-time events and scientific visualization environments often need events with multi-media information. These requirements can be met by highly specialized implementations and cannot be addressed by a generalized framework designed for the Grid environment. SOAP by itself is not efficient for large scale scientific applications but can be effectively used for sending signals and small size information packets in a platform and language independent manner . Thus SOAP seems like an attractive format to specify a event system in a Grid based environment.
The core requirement of Grid SOAP Events consists of a definition for the base SOAP event type and a specification of a SOAP RPC call to an event listener.
Figure 1 represents an XML-Schema for a base event type. It draws from the essential features of events in the Jini system. It represents the minimal information that any event is expected to contain. The eventNamespace field along with eventType uniquely identifies the event. The eventType hierarchy is differentiated with dots: for example an event of type notebook.experiment.LinearSolver is a subtype of notebook.experiment. The source identifies the originating point of the event while the timestamp represents the elapsed time in milliseconds since midnight, 1 January 1970. The seqNo helps in providing support for different delivery protocols.
The event type is also described using an event schema. Figure 2 shows an example of a resource event encoded in XML. The schema definition for this event derives from the base event type. Figure 3 shows the definition of the XML-schema that provides a formal specification for the derived event type instance. We plan to use RDDL (Resource Directory Description Language)  to associate metadata information with SOAP event types.
When an event is received from the wire its type needs to determined so that the values of the elements in the XML payload can be extracted. To achieve this a mapping needs to exist between an XML-Schema and a C++ or Java class in the runtime environment. The event system can then query the class to obtain the values of its fields. If such a mapping doesn't exist for the specified schema type then the event system should throw an exception which in turn should be represented on the wire as a SOAP-Fault element.
Figure 4 shows a simple API for a listener of SOAP events. Note that the type specified in the event is the base type. However, since SOAP supports polymorphism through the XML-Schema Instance type attribute (xsi:type), a derived type can be sent. Mapping events to classes specific to the runtime environment is required only at the receiving end. A run time mapping to the language specific event object can be established as the type of event is read from the xsi:type in the XML payload.
An event channel in our proposed system can be used to connect event listeners and event publishers. Figure 6 shows the SOAP API for an event channel.
Remote references are handles to objects that reside on remote machines. Direct connections using sockets are not reliable as access may be blocked by firewalls. Remote references allow communication between publishers and subscribers using proxy servers or direct connections. Remote references can be stored in LDAP and can be used to implement third party objects as is done in Jini.
Figure 7 shows an XML representation of a remote reference. The remote reference contains the location of the remote endpoint (web service) for an event service. The port type that describes the kind of event service provided is uniquely identified by the uri of its interface and its name. However, the port type may even point to a Web Services Description Language (WSDL)  instance. To interoperate with Apache SOAP  the URI of the endpoint is also required. The endpoint may have bindings that specify how the parameters of the payload should be interpreted. The representation of a remote reference as an XML string makes it easy to store it in a directory service.
Although an event publisher can be as light-weight as a simple embedded system inserting text into preformatted strings, robustness may require more utility. When a publisher restarts after a crash, it may not be able to recover the entire list of listeners that were subscribed to it. Persistence of an event channel in the face of failures and location independent mechanism to find new location of event channel is a well known problem. The straightforward solution of each publisher keeping a persistent database of listeners is not viable. For example, ``resource sensors'' run on host machines and report utilization to remote monitors. Resource sensors are barely-tolerated guest processes on remote machines and must have a small footprint - ruling out using heavy weight persistence.
A widely accepted solution in this case is to use a leasing mechanism. A subscription to an event channel must be periodically renewed so that robustness of the event system can be maintained. To achieve this the event channel grants a lease to its subscribers and each subscriber holds the responsibility of renewing its lease. When the event channel has to be restarted, all listeners eventually resubscribe (when renewing their lease) and event distribution resumes after a temporary lapse.
Figure 8 shows the SOAP API for a Leasing-Event publisher. The subscription call accepts a remote reference as a parameter along with a lease duration. The publisher returns a lease object (see Figure 9) indicating the lease that has been provided. This lease duration may or may not be the same as what was requested. The filter argument can be used to indicate filtering requirements. The handback argument is sent back to the listener along with the event. The listener can use it to identify the event and use to determine how to react to the event.
Figure 10 shows the HTTP header in a SOAP call to a lease-publisher. The wire representation of a remote reference is shown in figure 11. The SOAPAction header can be required for some SOAP based applications and firewalls, and indicates the intent of the message as to what service it wants to invoke the method on.
Event producers and consumers need to find each other on the Grid. The LDAP hierarchical model allows us to provide meaningful names to event channels and model dependencies (see figure 12). Local event channels can connect to higher level group channels which in turn can be connected to an organization level event channel. It is even possible to have a direct connection between event channels at startup time or dynamically at runtime (see Figure 13)
SOAP RPC uses HTTP as the underlying transport protocol. HTTP protocol is ``firewall friendly'' since port 80 on which HTTP traffic flows is guaranteed to be open in all systems running httpd. The SOAP specification states that data on the wire should be transmitted as plain text. This helps in easy inspection of the data that is received on the firewall-port.
Grid SOAP event framework specifies simple and minimal requirements for an event and form the foundation for an extensible framework for subscribers and listeners. By specializing the publisher and event channel to provide leasing, SOAP events can be deployed on the Internet and provide robustness in the face of intrinsic failures and crashes of subscribers and listeners. Basing the naming and directory service support for SOAP events on LDAP lends scalability in wide area networks such as the Grid or Internet. To work in both Intranet and Internet environments it is important for an event system to be firewall-aware.