I did not work with SimpleDB, but I mapped ActiveResource with the Amazon Flexible Payments Service REST api and just look at the documents that they seem similar, so here basically what I have done, maybe you can use this as a starting point.
require 'base64' require 'openssl' class AmazonFlexiblePaymentResource < ActiveResource::Base self.site = AMZ_CONFIG['flexible_api_url'] def self.rest_api(options = {}) params = common_request_params.update(options) sig = compute_signature(AMZ_CONFIG['secret_access_key'], 'get', site, params) rest_req = {'Signature' => sig}.update(params)
Then i just make such calls
res = AmazonFlexiblePaymentResource.rest_api({ 'Action' => 'GetTransactionStatus', 'TransactionId' => '1234567890ABCDEFGHIJ' })
And the answer is the hash of the parsed xml. This again works for Amazon’s flexible payment service, so you may need to make adjustments to match the SimpleDB REST API.
Corey
source share