Sunday, April 22, 2007

 

Amazon Web Services really is a doddle

I've been planning for as long as I can remember to get my head round Amazon's API.
It was one of my new year's resolutions and I mentioned it again in a post last week.

David Fiske replied in the comments and assured me it was a doddle.

Turns out he was right!

After David's useful encouragement, I spent the latter part of last week getting into it. I had assumed it would be be a complicated development project so fired up my Visual Web Developer (which I save for what I consider *proper coding* tasks) and started off down that road.

Then with a little bit more reading, I discovered that the easier way to work with Amazon's Web Services was using XML over HTTP (known as REST). If you're not familiar with it, it basically means you construct a URL which points at Amazon's Web Services and the parameters in the query string allow you to return data you want which comes back in XML form.

You then need to work with the XML anyway you feel comfortable to display it on your page. I work in .net and the nested XML that was returned didn't bind too easily to .net controls like repeaters and datagrids etc, so I then had to go off on a tangent learning about XSLT which enabled me to control the layout of the XML returned and make it more suitable for how I wish to use it. Once I had "flattened" the XML results and only included info I required, I was able to simply bind them to .net controls.

I'm not entirely sure I went about things the best way, but managed to end up doing exactly what I wanted and getting the Amazon toy section listed on my new site, Toys And Videogames. It was actually really enjoyable to get my teeth into some new technologies and actually learn what feels like a new skill. I'll now be looking at adding Amazon Web Services to more sites so they can be live without me having to update them myself. In my researching, I didn't find any really useful sites that explained fully about this route I've taken, so look out for a walkthrough soon.

Labels: , , ,



Comments:
I like the site! Told you it was easy! I use PHP so parsing XML is fairly straight forward. .Net is a different kettle of fish altogether!
 
Post a Comment





<< Home

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]