Geekspeak: July 29, 2002
Accessing Amazon.com using XML.In April, Amazon.com released a web services query interface for its catalog. I thought this was a great feature but was disappointed that it didnt use SOAP since so many languages support that standard. Amazon used a REST (Representational State Transfer) interface, where queries are issued using custom URLs and data is returned as plain XML. This is still a lot better than screen-scraping HTML pages, so over the July 4 holiday, I fired up a copy of Suns new Sun ONE Studio 4 and developed a Java client API for the Amazon REST interface.
Since the codes main job is to parse Amazon.coms XML, I evaluated several Java XML libraries, looking for the least complicated option. Java has native support for DOM and SAX APIs, but I found them both too low-leveltoo much code was required for something that should be simple. I then looked at two other libraries, Dom4j (www.dom4j.org) and JDOM (www.jdom.org), as well as two data-binding frameworks, Castor (www.castor.org) and Suns JAXB.