[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Amazon Webservice + soap/wsdlDriver => weird errors

Titou Titou

9/5/2007 8:50:00 AM

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...

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&Subsc...[access_key_HERE]&Operation=ItemLookup&SearchIndex=Books&IdType=ISBN&ItemId=2841773884

if someone can help...

thanks.

PB
--
Posted via http://www.ruby-....