Home > Archive >  2008 >  January >  11


Amazon SimpleDB followup

Friday, January 11, 2008 by Dave Winer.

I spent a few days over the last week trying to get a connection between Frontier and Amazon's SimpleDB.  Permalink to this paragraph

I got connections going with: CreateDomain, DeleteDomain, ListDomains. They all use the same basic code to handle authentication, and all three work. Permalink to this paragraph

But I hit a dead-end with the PutAttributes call. At first I thought I had found a problem on their end, because their JavaScript scratchpad app (a life-saver) had exactly the same problem as my code. I got in touch with the Amazon people, they asked me to download a new version of the scratchpad app, and it worked, but of course my app still doesn't. I compared my parameter list to theirs, and except for the signature and time-stamp they are identical. So there's something wrong with my code, clearly.  Permalink to this paragraph

Here's a link to a plain text listing of the code. All four of the interface routines use this code to call the Amazon web service. This is the place the problem almost certainly is.  Permalink to this paragraph

And here's the interface for PutAttributes.  Permalink to this paragraph

As often happens, the geeky readers of this blog may spot the mistake that I don't, so all suggestions are welcome. I really want to get past this and start building applications that connect with this new web service.  Permalink to this paragraph

A picture named bigGulp.jpgUpdate: Problem solved? I got an email from my contact at Amazon, he suggested maybe I wasn't sorting the parameters before generating the signature. I checked, he was right. At one point I had been sorting them, but in an attempt to solve another problem, took a different approach which left the parameters not-sorted. Had I taken another look at the docs I would have seen that the params must be sorted before generating the signature. When I re-coded it so that they were sorted, PutAttributes worked! Heh. So now I have to do some more testing to be sure I really have the answer, but it looks pretty good. ;-> Permalink to this paragraph






© Copyright 1994-2008 Dave Winer Mailto icon.

Last update: 1/11/2008; 8:31:49 PM Pacific. "It's even worse than it appears."

Click here to view blogs commenting on  RSS 2.0 feed.