I'm new to Ruby and Web Services.

I'm trying to use Commision Junction's Web services.

I've run a couple example web services with Ruby, so I'm confidents that 
my env is setup properly. I've also connected to the CJ webservice using 
PERL, so the service is working fine.

Here is my code:

require 'soap/wsdlDriver'
wsdl = 'http://api.cj.com/wsdl/productSearchService.wsdl'
driver = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver

Here is a warning that I get:

ignored attr: {}nillable

I'm not sure what this means...I'm assuming that the wsdl isn't being 
read correctly.

If I ignore that, and continue, here is what I get.

developerKey = 'my actual developer key'
websiteId = a website id number
keywords ="test keyword"
result = driver.search(developerKey, websiteId, '', keywords, '', '', 
'', '', '', '', '', '', '', 0, 3)

Console output:

ignored attr: {}nillable
/usr/local/lib/ruby/1.8/soap/rpc/driver.rb:230:in `search': wrong number 
of arguments (15 for 1) (ArgumentError)

Following that, I tried:

param = { 'developerKey' => 'my key',
'websiteId' => 'my website id',
'advertiserIds' => '',
'keywords' => 'test',
'serviceableArea' => '',
'upcOrIsbnOrEan' => '',
'manufacturerName' =>'',
'advertiserSku' => '',
'lowPrice' => '',
'highPrice' => '',
'currency' => '',
'sortBy' => '',
'orderIn' => '',
'startAt' => 0,
'maxResults' => 3 }

result = driver.search(param)

Booyah...I got past the number of params error, but still no luck

ignored attr: {}nillable
warning: peer certificate won't be verified in this SSL session
#<SOAP::Mapping::Object:0x1047ffc>: no SOAPAction header! 
(SOAP::FaultError)

So I got the feeling that this all has something to do with the:

ignored attr: {}nillable

But I'm not sure how to troubleshoot further.

Any ideas?

-- 
Posted via http://www.ruby-forum.com/.