Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 722695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T06:01:12+00:00 2026-05-14T06:01:12+00:00

Im looking for a way to map an ActiveResource to SimpleDB I want to

  • 0

Im looking for a way to map an ActiveResource to SimpleDB

I want to avoid plugins/gems as all I have used are outdated/buggy/not mantained

It doesnt seem hard, I wonder if any of you have succesfully implemented a rails app with simpleDB as an Active Resource. How did you do it? Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T06:01:13+00:00Added an answer on May 14, 2026 at 6:01 am

    I haven’t worked with SimpleDB, but I have mapped ActiveResource to Amazon’s Flexible Payments Service REST api and just skimming the docs they seem similar so here’s basically what I did, 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)
    
        # make the http get call
        connection.get("/#{query_string(rest_req)}", headers)
      end
    
      protected
    
      # these are the params are common to all rest api calls
      def self.common_request_params
        { 'AWSAccessKeyId' => AMZ_CONFIG['access_key_id'],
          'SignatureVersion' => 2,
          'SignatureMethod' => 'HmacSHA256',
          'Timestamp' => Time.now.utc.iso8601,
          'Version' => '2008-09-17'}
      end
    
      def self.compute_signature(key, method, end_point_url, params)
        query_str = parameters.sort.collect {|k, v| v.to_query(k)}.join '&'
    
        # cannot use plus for space, and tilde needs to be reversed
        query_str.gsub!('+', '%20')
        query_str.gsub!('%7E', '~')
    
        to_sign = [method.upcase, end_point_uri.host.downcase,
            end_point_uri.request_uri, query_str].join "\n"
    
        digest = OpenSSL::Digest::Digest.new('sha256')
        hmac = OpenSSL::HMAC.digest(digest, key, to_sign)
        Base64.encode64(hmac).chomp
      end
    end
    

    Then I just make calls like this

    res = AmazonFlexiblePaymentResource.rest_api({ 'Action' => 'GetTransactionStatus', 'TransactionId' => '1234567890ABCDEFGHIJ' })
    

    And the response is a hash of the parsed xml. Again this works for Amazon Flexible Payments Service, so you may need to make adjustments to match the SimpleDB REST API.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking for a way to map some hot-keys to delete the line that
I'm looking for a way to map a simple insert stored procedure using NHibernate
I'm looking for way to write Javascript programs / scripts on desktop, not inside
In Java I'm looking for a way to map multiple keys to the same
I'm looking for a way to have Enum a => UArray a (which makes
I'm looking for a way to read from an external text file map.txt (allocated
I have a question about the recommended way to map a conversation tree to
I am looking for a way to zip a multikey map to a normal
I'm looking for a way to map types, f.i. having a class Double: class
I have been looking for a way to do the following action using the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.