A quick update...

I wanted to note, while I'm thinking about it, that accessing the Amazon.com Web Services from ASP.NET is surprisingly easy. The only tricky part I found was dealing with the built-in limitation of 10 results per request.

I wanted to pull all of the data for a given keyword search (ASP.NET, naturally) into a single dataset, to allow the use of the built-in paging feature of the DataGrid control. I figured that, in order to reduce the expense of querying the Web Service 16 times (159 results / 10 items per request), it would probably be a good idea to store the results locally, and only update them if they're older than, say, a half an hour.

The problem I ran into was that I was trying to use the ReadXML and WriteXML methods of the DataSet class in a loop, which turned out to be a bad idea. What I ended up doing, was creating a new DataSet outside the loop, reading in an XSD schema to set up the table, then within the loop, pulling in the data from a given request, and merging that data with the data from previous requests using the Merge method of the DataSet class, like so:

NewDS.Merge(FillAmazonDS(NewDS, AmazonRes))

Then, once the loop completes, I write the data to the XML file.

If anyone's interested, I'll post the working code. In the meantime, you can find out more about using the Amazon.com Web Services with .NET/ASP.NET at the following URLs:

http://aspalliance.com/wisemonk/view.aspx?id=AN071902
http://www.xmlforasp.net/codeSection.aspx?csID=76
http://www.ondotnet.com/pub/a/dotnet/2002/07/18/amazon.html

No Comments