Java Reference
In-Depth Information
NOTE
If you're interested in working with Atom, check out the Apache Abdera project, which implements
both the Atom Publishing Protocol and the Atom Syndication Format. As of this writing, it is still
in Incubator status. You might also check out https://rome.dev.java.net/ , which is a Sun open source
project that implements both Atom and various versions of RSS.
Here are a few simple examples of working with Atom. To retrieve a document, you might
provide an HTTP request like this:
GET http://finance.google.com/finance/feeds/default/portfolios HTTP/1.1
No content is required in the body of the request. The service at that URI should then respond
with a list of available entries in the collection, indicating the choices for your next path. Here
is how the Google Finance API responds to a request for retrieving the list of a given user's
portfolios:
<feed xmlns='http://www.w3.org/2005/Atom'
xmlns:gf='http://schemas.google.com/finance/2007'
xmlns:gd='http://schemas.google.com/g/2005'>
<id>http://finance.google.com/finance/feeds/someUser@gmail.com/
portfolios</id>
<updated>2008-09-14T01:29:50.000Z</updated>
<category scheme='http://schemas.google.com/g/2005#kind'
term='http://schemas.google.com/finance/2007#portfolio'/>
<title type='text'>Portfolio Feed</title>
<link rel='alternate' type='text/html'
href='http://finance.google.com/finance/portfolio?action=view'/>
//...
This is a standard Atom response, indicating a set of available links that represent the actions
you could take next. Notice that certain key RESTful properties are at work here: the doc-
uments (representations) are given unique URIs, allowing the client to remain in charge of
transferring state. This is also lightweight, requiring no external platform-specific libraries. If
the platform can talk HTTP, it can work with the service. This is not always the case in the
world of WS-*, where different platforms may or may not implement different specifications,
making out-of-band negotiation and client alternatives more important and complex.
Search WWH ::




Custom Search