Summary
In a recent blog post, Sun's David Van Couvering ponders the best way to expose a RESTful Web service.
Advertisement
As REST is gaining popularity as an interface to Web-based data services, developers are looking for effective ways to implement REST services. Some prefer to expose RESTful URLs as a way to interact with a service. Increasingly, however, service providers wrap a RESTful API into some other format, such as an application-specific API or the more general-purpose Atom Publishing Protocol (APP) format. An example of the latter is Google's GoogleBase API.
In a recent blog post, Why use Atom Publishing Protocol for REST?, Sun's David Van Couvering invites his readers to debate the merits of the Atom-based approach. He quotes several advantages of using Atom for REST:
APP lets you post a new entry without having to know its URI. The protocol lets the server tell you where it put it as part of the response. This allows the server to allocate things as it sees fit, and decouples the client and server. This feature also seems key to me for solutions that need to scale—you don't want to hardcode locations into the client.
Because APP and Atom are growing and popular standards, lots of products are or will be working with it. As a simple example, when I was testing my Atom server with my browser, at first I was just getting raw XML displayed (through a plugin). But when I finally got the response right and sent a valid Atom feed, all of a sudden Google Reader popped in and asked me if I wanted to subscribe to the feed. Sweet!
Because APP and Atom are growing and popular standards, people are providing and will continue to provide tools to make it easy to build APP servers and clients. ROME and Apache Abdera are just two examples of this.
In your experience, what is the best way to expose a RESTful service? Would you use Atom for the reasons Van Couvering mentions in his blog?
Hello Guys.. I am new to Atom Feeds. So thought of writing a sample feed, but i am struck implementing it. When i am trying to pull the feed content using a servlet, the servlet is just showing the html body content..the code i used to extract the feed is package Atom;