Geekspeak: July 29, 2002

 
 
By Timothy Dyck  |  Posted 2002-07-29 Email Print this article Print
 
 
 
 
 
 
 

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-level—too 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.

Dom4j was my pick—its easy to use and has built-in support for XPath, and it kept my code simple and short.

While writing this, I discovered that Amazon.com just announced (as of July 16) Version 1.0 of its XML query interface, which now supports SOAP as well as the REST interface. It was a fun exercise, anyway.

 
 
 
 
Timothy Dyck is a Senior Analyst with eWEEK Labs. He has been testing and reviewing application server, database and middleware products and technologies for eWEEK since 1996. Prior to joining eWEEK, he worked at the LAN and WAN network operations center for a large telecommunications firm, in operating systems and development tools technical marketing for a large software company and in the IT department at a government agency. He has an honors bachelors degree of mathematics in computer science from the University of Waterloo in Waterloo, Ontario, Canada, and a masters of arts degree in journalism from the University of Western Ontario in London, Ontario, Canada.
 
 
 
 
 
 
 

Submit a Comment

Loading Comments...
 
Manage your Newsletters: Login   Register My Newsletters























 
 
 
 
 
 
 
 
 
 
 
Thanks for your registration, follow us on our social networks to keep up-to-date
Rocket Fuel