Amazon E-commerce Webservice + soap/wsdlDriver = weird error

Hi,

I’m trying to use amazon E-commerce Webservice using soap/wsdlDriver.
The idea is that a user gives an ISBN, ant to get book informations.

Here’s my code :

require ‘soap/wsdlDriver’

URL =
http://webservices.amazon.com/AWSECommerceService/FR/AWSECommerceService.wsdl

access_key = ‘XXXXXXX’

my_isbn10 = ‘2841773884’ # Pratique de Ruby on Rails - Eric Sarrion

factory = SOAP::WSDLDriverFactory.new(URL).create_rpc_driver

mes_params = {
‘AWSAccessKeyId’ => access_key,
‘Service’=>‘AWSECommerceService’,
‘SearchIndex’ => ‘Books’,
‘IdType’ => ‘ISBN’,
‘ItemId’ => my_isbn10
}

result = factory.ItemLookup(mes_params)
puts result.inspect

bud i get a weird error :

Message=“Your request is missing required parameters. Required
parameters include ItemId.”

I tried changing my hash this way :

mes_params = {
‘AWSAccessKeyId’ => access_key,
‘Service’=>‘AWSECommerceService’,
‘Request’ => {
‘SearchIndex’ => ‘Books’,
‘IdType’ => ‘ISBN’,
‘ItemId’ => my_isbn10
}
}

but then, another error occured :

Message=“You have exceeded the maximum number of batch requests per
operation. Each operation may include no more than 2 batch requests.”

more strange if possible, when using directly the REST request in my
browser, i get the expected result :

http://webservices.amazon.fr/onca/xml?Service=AWSECommerceService&SubscriptionId=[access_key_HERE]&Operation=ItemLookup&SearchIndex=Books&IdType=ISBN&ItemId=2841773884

if someone can help…

thanks.

PB

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs