Web, July 9 2003, by DeveloperDude.
This document describes the Portable and Simple Syndication API that allows pragramatic access to RSS databases. The PSS standard was developed in order to extend RSS 2.0 constructs beyong the RSS file. By incorporating the RSS elements into other APIs, we can then create new XML applications that interoperate well with RSS-based applications.
The PSSAPI includes three methods that can be expressed functionally as the following.
By default the PSSAPI is implemented over the SOAP/HTTP RPC, but any RPC mechanism would suffice. It is strongly recommended that you use the SOAP/HTTP RPC where applicable. It is also strongly recommended that you use UsernameToken authorization as described in the standard WS-Security [http://www-106.ibm.com/developerworks/library/ws-secure/].
Adding a new item to an RSS feed, has the meaning of prepending the item to the beginning of the RSS data source.
A sample pssapi.newItem request follows.
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/04/secext" >
<soap:Header>
<wsse:Security> <wsse:UsernameToken> <wsse:Username>randy</wsse:Username> <wsse:Password>hello</wsse:Password> </wsse:UsernameToken> </wsse:Security> </soap:Header>
<soap:Body>
<pssapi:newItem xmlns:pssapi="http://tempuri.org/object" >
<pss:item xmlns:pss="http://duderesearch.com/archives/000010.html" >
<pss:title>My Title</pss:title>
<pss:link>http://tempuri.org/object</pss:link>
<pss:description>some content</pss:description>
</pss:item>
</pssapi:newItem>
</soap:Body>
</soap:Envelope>
A sample pssapi.newItem response follows. Note, the response is an echo of the request without the authentication module in the header. The response may add or change elements to fit the data sources specific RSS flavor. For instance, if the source was implementing RSS 0.91 or RSS 1.0, the items could change in style drastically.
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" >
<soap:Body>
<pssapi:newItem xmlns:pssapi="http://tempuri.org/object" >
<pss:item xmlns:pss="http://duderesearch.com/archives/000010.html" >
<pss:title>My Title</pss:title>
<pss:link>http://tempuri.org/object</pss:link>
<pss:description>some content</pss:description>
</pss:item>
</pssapi:newItem>
</soap:Body>
</soap:Envelope>
A typical fault response follows.
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" >
<soap:Body>
<soap:Fault>
<soap:Code>
<soap:Value>soap:Sender</soap:Value>
</soap:Code>
<soap:Reason>Request was incorrect.</soap:Reason>
</soap:Fault>
</soap:Body>
</soap:Envelope>
Editing an existing item in an RSS feed, has the meaning of modifying the item in place in the RSS data source.
A sample pssapi.editItem request follows.
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/04/secext" >
<soap:Header>
</soap:Header>
<soap:Body>
<pssapi:editItem xmlns:pssapi="http://tempuri.org/object" >
<pss:item xmlns:pss="http://duderesearch.com/archives/000010.html" >
<pss:title>My Title</pss:title>
<pss:link>http://tempuri.org/object</pss:link>
<pss:description>some content</pss:description>
<pss:guid>http://tempuri.org/guid</pss:guid>
</pss:item>
</pssapi:editItem>
</soap:Body>
</soap:Envelope>
A sample pssapi.editItem response follows. Note, the response is an echo of the request without the authentication module in the header. The response may add or change elements to fit the data sources specific RSS flavor. For instance, if the source was implementing RSS 0.91 or RSS 1.0, the items could change in style drastically.
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" >
<soap:Body>
<pssapi:editItem xmlns:pssapi="http://tempuri.org/object" >
<pss:item xmlns:pss="http://duderesearch.com/archives/000010.html" >
<pss:title>my title</pss:title>
<pss:link>http://tempuri.org/object</pss:link>
<pss:description>some content</pss:description>
<pss:guid>http://tempuri.org/guid</pss:guid>
</pss:item>
</pssapi:editItem>
</soap:Body>
</soap:Envelope>
Deleting an existing item in an RSS feed, has the meaning of removing the item from the RSS data source.
A sample pssapi.deleteItem request follows.
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/04/secext" >
<soap:Header>
<wsse:Security>
<wsse:UsernameToken>
<wsse:Username>randy</wsse:Username>
<wsse:Password>hello</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soap:Header>
<soap:Body>
<pssapi:deleteItem xmlns:pssapi="http://tempuri.org/object" >
<pss:item xmlns:pss="http://duderesearch.com/archives/000010.html" >
<pss:guid>http://tempuri.org/guid</pss:guid>
</pss:item>
</pssapi:deleteItem >
</soap:Body>
</soap:Envelope>
A sample pssapi.deleteItem response follows. Note, the response is an echo of the request without the authentication module in the header. The response may add or change elements to fit the data sources specific RSS flavor. For instance, if the source was implementing RSS 0.91 or RSS 1.0, the items could change in style drastically.
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" >
<soap:Body>
<pssapi:deleteItem xmlns:pssapi="http://tempuri.org/object" >
<pss:item xmlns:pss="http://duderesearch.com/archives/000010.html" >
<pss:guid>http://tempuri.org/guid</pss:guid>
</pss:item>
</pssapi:deleteItem >
</soap:Body>
</soap:Envelope>
Please note that although I include only one method in each each example, there is not limitation to one method call per request. Theoretically, you could have a mix of newItem, editItem and deleteItem methods in each request. You can also have more than one of each request type.
<soap:Body>
<pssapi:newItem xmlns:pssapi="http://tempuri.org/object" >
<pss:item xmlns:pss="http://duderesearch.com/archives/000010.html" >
<pss:title>mytitle</pss:title>
<pss:link>http://tempuri.org/object</pss:link>
<pss:description>mytitle</pss:description>
</pss:item>
</pssapi:newItem>
<pssapi:editItem xmlns:pssapi="http://tempuri.org/object" >
<pss:item xmlns:pss="http://duderesearch.com/archives/000010.html" >
<pss:title>My Title</pss:title>
<pss:link>http://tempuri.org/object</pss:link>
<pss:description>some content</pss:description>
<pss:guid>http://tempuri.org/guid</pss:guid>
</pss:item>
</pssapi:editItem>
</soap:Body>
Within each method request, you could also have more than one item. This allows the programmer to add, edit or delete multiple items per method request.
<soap:Body>
<pssapi:newItem xmlns:pssapi="http://tempuri.org/object" >
<pss:item xmlns:pss="http://duderesearch.com/archives/000010.html" >
<pss:title>mytitle</pss:title>
<pss:link>http://tempuri.org/object</pss:link>
<pss:description>mytitle</pss:description>
</pss:item>
<pss:item xmlns:pss="http://duderesearch.com/archives/000010.html" >
<pss:title>My Title</pss:title>
<pss:link>http://tempuri.org/object</pss:link>
<pss:description>some content</pss:description>
</pss:item>
</pssapi:newItem>
</soap:Body>
Note also that you are not limited to the four basic elements of an RSS item; title, link, description and guid. You can also use any of the other elements; pubDate, category, etc. You can also include elements from many of the extensions like trackbacks and the comment api.
It is not advised to use PSSAPI with obsolete flavors of RSS like version 0.91 and version 1.0. Incompatibilities in the data set make programmatic control cumbersome with these version of RSS. It is also strongly advised against using funky RSS with PSSAPI.
Assuming Pie/Echo makes it to adoption, then this document applies equally to this format. Only samples are provide as Pie/Echo is still far from complete. Even the example should only be considered for form and not content as the element of Pie/Echo are in a lot of flux.
I was originally going to write this solely for RSS, but decided that it was trivial enough to add support for Pie/Echo.
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/04/secext" >
<soap:Header>
<wsse:Security> <wsse:UsernameToken> <wsse:Username>randy</wsse:Username> <wsse:Password>hello</wsse:Password> </wsse:UsernameToken> </wsse:Security> </soap:Header>
<soap:Body>
<pssapi:newItem xmlns:pssapi="http://tempuri.org/object" >
<pie:entry xmlns:pie="http://tempuri.org/object" >
<pie:title>My Title</pie:title>
<pie:link>http://tempuri.org/object</pie:link>
<pie:content type="text/html" >some content</pie:content >
</pie:entry>
</pssapi:newItem>
</soap:Body>
</soap:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" >
<soap:Body>
<pssapi:newItem xmlns:pssapi="http://tempuri.org/object" >
<pie:entry xmlns:pie="http://tempuri.org/object" >
<pie:title>My Title</pie:title>
<pie:link>http://tempuri.org/object</pie:link>
<pie:content type="text/html" >some content</pie:content >
</pie:entry >
</pssapi:newItem>
</soap:Body>
</soap:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/04/secext" >
<soap:Header>
</soap:Header>
<soap:Body>
<pssapi:editItem xmlns:pssapi="http://tempuri.org/object" >
<pie:item xmlns:pie="http://tempuri.org/object" >
<pie:title>my title</pie:title>
<pie:link>http://tempuri.org/object</pie:link>
<pie:content type="text/html" >some content</pie:content >
</pie:item>
</pssapi:editItem>
</soap:Body>
</soap:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" >
<soap:Body>
<pssapi:editItem xmlns:pssapi="http://tempuri.org/object" >
<pie:item xmlns:pie="http://tempuri.org/object" >
<pie:title>my title</pie:title>
<pie:link>http://tempuri.org/object</pie:link>
<pie:content type="text/html" >some content</pie:content >
</pie:item>
</pssapi:editItem>
</soap:Body>
</soap:Envelope>
A sample pssapi.deleteItem request follows.
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/04/secext" >
<soap:Header>
<wsse:Security>
<wsse:UsernameToken>
<wsse:Username>randy</wsse:Username>
<wsse:Password>hello</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soap:Header>
<soap:Body>
<pssapi:deleteItem xmlns:pssapi="http://tempuri.org/object" >
<pie:item xmlns:pie="http://tempuri.org/object" >
<pie:link>http://tempuri.org/guid</pie:link>
</pie:item>
</pssapi:deleteItem >
</soap:Body>
</soap:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" >
<soap:Body>
<pssapi:deleteItem xmlns:pssapi="http://tempuri.org/object" >
<pie:item xmlns:pie="http://tempuri.org/object" >
<pie:link>http://tempuri.org/guid</pie:link>
</pie:item>
</pssapi:deleteItem >
</soap:Body>
</soap:Envelope>
I've always been an RSS and SOAP fan. I recently implemented BloggerAPI and MetaWeblogAPI and found them cumbersome. I don't think the average programmer stands a chance with XML-RPC. Beyond that neither API is complete and only recently MetaWeblogAPI provided supported for deleting items (BloggerAPI simply doesn't). Then half way thru writing this, Jon Udell called for a SOAP blogging protocol. That was fait accompli.
dingbat
I'm advising not prohibiting.
As for RSS 1.0, the RSS 1.0 players seem willing to abandon 1.0 in favor of Echo, Swartz et al.
Randy