Internet technology hosted by Berkman Center

SOAP Meets RSS

Thursday, July 17, 2003

Publish and subscribe 

Most aggregators scan for changes once an hour, but in some situations we want to know immediately when a channel has changed. For example, we include RSS Boxes on many of our sites. When an editor routes a item to a box, we want the news to be displayed immediately, but we don't want to read the RSS channel on every hit. Notification makes it possible to always be current yet conserve bandwidth and server cycles.

A new feature for RSS 

There's a new <cloud> sub-element of <channel>. It specifies a Web application that supports the rssCloud interface, described below, which can be implemented in either XML-RPC or SOAP.

A has five required attributes: domain is the domain name or IP address of the cloud, port is the TCP port that the cloud is running on, path is the location of its responder, registerProcedure is the name of the procedure to call to request notification, and protocol is xml-rpc, soap or http-post (case-sensitive), indicating which protocol is to be used.

Example 

Here's an example of a RSS file that includes the new element.

<cloud domain="radio.xmlstoragesystem.com" port="80" path="/RPC2" registerProcedure="xmlStorageSystem.rssPleaseNotify" protocol="xml-rpc" />

This is telling the aggregator to send an XML-RPC message to radio.xmlstoragesystem.com on port 80, with path /RPC2 to the procedure named xmlStorageSystem.rssPleaseNotify to request notification.

Most RSS files produced by Radio UserLand have a element.

rssCloud interface 

A workstation calls the cloud to register. The procedure takes five parameters: the name of the procedure that the cloud should call to notify the workstation of changes, the TCP port the workstation is listening on, the path to its responder, a string indicating which protocol to use (xml-rpc or soap, case-sensitive), and a list of urls of RSS files to be watched. The cloud can determine the IP address of the caller from the request. A workstation cannot make a registration call on behalf of another. The cloud returns true if it was able to do the registration, false otherwise.

When a subscribed-to channel changes the cloud calls back to the procedure named in the registration call with one parameter, the url of the channel that changed. At that point the workstation could read the channel, or notify other workstations that the channel has changed, clear a cache, send an email or do nothing. The workstation returns true.

By convention registrations expire after 25 hours. Workstations should register every 24 hours for each subscription to keep them current.

UserLand is operating a cloud that conforms to this spec at radio.xmlstoragesystem.com. The workstation side is implemented in Radio UserLand.

Important caveat 

By design, this protocol/format will not work for aggregators that are isolated from the Internet by firewalls or NAT. It will work for systems with non-fixed IP addresses if the workstation software re-registers at startup.

See also: RSS 2.0 spec.