# Problem with SOAP and Commision Junction web services

**URL:** <https://www.ruby-forum.com/t/problem-with-soap-and-commision-junction-web-services/71323>\
**Category:** Ruby\
**Created:** [October 6, 2006, 11:18pm UTC](https://www.ruby-forum.com/t/problem-with-soap-and-commision-junction-web-services/71323 "2006-10-06T23:18:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrismalek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/6de8d8/32.png) [@chrismalek](https://www.ruby-forum.com/u/chrismalek)\
**Post date:** [October 6, 2006, 11:18pm UTC](https://www.ruby-forum.com/t/problem-with-soap-and-commision-junction-web-services/71323/1 "2006-10-06T23:18:02Z")

</div>

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](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?

---

<div class="post-metadata">

**Author:** ![chrismalek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/6de8d8/32.png) [@chrismalek](https://www.ruby-forum.com/u/chrismalek)\
**Post date:** [October 7, 2006, 6:13am UTC](https://www.ruby-forum.com/t/problem-with-soap-and-commision-junction-web-services/71323/2 "2006-10-07T06:13:35Z")

</div>

> ignored attr: {}nillable

Never seen this before, it seems safe to ignore this… for now.

> warning: peer certificate won’t be verified in this SSL session  
> #SOAP::Mapping::Object:0x1047ffc: no SOAPAction header!  
> (SOAP::FaultError)

You should install the latest version of http-access2. The default  
HTTP driver that soap4r uses munges the “SOAPAction” header into  
“Soapaction” which Commission Junction’s Java SOAP implementation  
doesn’t like. http-access2 preserves the header properly.

You can get it here: [http://dev.ctor.org/http-access2](http://dev.ctor.org/http-access2).

After you install http-access2 you need to tell it to ignore the self  
signed certificate by adding the following line of code.

driver.options[“protocol.http.ssl\_config.verify\_mode”] = nil

As a next step, I recommend using wsdl2ruby to generate the stub  
classes off the WSDL definitions. Everytime you call  
SOAP::WsdlDriverFactory.new(), you’re adding the overhead of  
downloading the wsdl definitions for every search call (unless balance  
the amount of ws calls you make against the number of driver instances  
you have by caching them and keeping your ruby process alive or  
somesuch).

If you use wsdl2ruby, you’ll likely not see the nillable warning  
anymore.

---

<div class="post-metadata">

**Author:** ![chrismalek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/6de8d8/32.png) [@chrismalek](https://www.ruby-forum.com/u/chrismalek)\
**Post date:** [October 7, 2006, 10:12am UTC](https://www.ruby-forum.com/t/problem-with-soap-and-commision-junction-web-services/71323/3 "2006-10-07T10:12:28Z")

</div>

Thank you for the very detailed reply…it helped a lot.

By installing the latest version of http-access2 and setting the verify  
mode, I was able to connect to the service successfully.

I’m now experimenting with wsdl2ruby, and struggling a bit. I did still  
get the nillable warning when I ran wsdl2ruby, so it must not like the  
nillable attribute in the CJ wsdl file. It doesn’t seem like problem so  
far though. I am getting the same verification error as before now, so I  
just need to figure out how to set that option, using the object created  
by wsdl2ruby.

Thanks again.

---

<div class="post-metadata">

**Author:** ![chrismalek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/6de8d8/32.png) [@chrismalek](https://www.ruby-forum.com/u/chrismalek)\
**Post date:** [October 7, 2006, 11:01am UTC](https://www.ruby-forum.com/t/problem-with-soap-and-commision-junction-web-services/71323/4 "2006-10-07T11:01:52Z")

</div>

Hrm. That’s strange. I’ve been using CJ without that warning for  
awhile. I don’t think that this is an issue with CJ. I did upgrade to  
the latest tarball of soap4r, so maybe that will solve things?

What version of ruby are you running on? What does:

ruby -r soap/rpc/driver -e ‘puts SOAP::Version’

say?

---

<div class="post-metadata">

**Author:** ![chrismalek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/6de8d8/32.png) [@chrismalek](https://www.ruby-forum.com/u/chrismalek)\
**Post date:** [October 21, 2006, 9:22am UTC](https://www.ruby-forum.com/t/problem-with-soap-and-commision-junction-web-services/71323/5 "2006-10-21T09:22:21Z")

</div>

-----BEGIN PGP SIGNED MESSAGE-----  
Hash: SHA1

Hi,

Thanks eden.

eden li wrote:

> Hrm. That’s strange. I’ve been using CJ without that warning for  
> awhile. I don’t think that this is an issue with CJ. I did upgrade to  
> the latest tarball of soap4r, so maybe that will solve things?

Me too don’t get “ignored attr: {}nillable” warning from  
[CJ Developer Portal](http://api.cj.com/wsdl/productSearchService.wsdl) .  
Chris, can you once remove  
/usr/local/lib/ruby/site\_ruby/1.8/{soap,wsdl,xsd} and install soap4r  
again?

Regards,  
// NaHi  
-----BEGIN PGP SIGNATURE-----  
Version: GnuPG v1.4.2.1 (Cygwin)

iQEVAwUBRTnKMx9L2jg5EEGlAQKJFwgAh9wzwCIvA3FJ8MKbfa7e6I8vdFa+1AHP  
qn3lYDYWetkWANcB1HOWe2Jay8lZuWGqlfu0TzeuZkxce69xGE8iZn/bHbECCynE  
khRCM02EJBZXaozGNujH/VpCDyq/Ve5W8uBCn2plrsYMwnUupmpPsKGGIMdYE4Ww  
Z4QY0f6vNEkcRdGOK4UjWOQ62UN7pXXLkELsYV19cbO59tz3YskCq8k6mW9BUnbr  
ga2ukuVpCXEeGwHvu0BqcDHVBfVChkhCII2vTctyrj1h2P2XLa55jLYo0xALXSe8  
WN0W0BJ3AS/fdjTMicSLFKpva2HE0UA+sQeaSNaorBkcrO2JP2F/ng==  
=knd4  
-----END PGP SIGNATURE-----

---

<div class="post-metadata">

**Author:** ![chrismalek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/6de8d8/32.png) [@chrismalek](https://www.ruby-forum.com/u/chrismalek)\
**Post date:** [May 17, 2010, 8:46am UTC](https://www.ruby-forum.com/t/problem-with-soap-and-commision-junction-web-services/71323/6 "2010-05-17T08:46:06Z")

</div>

Hi,  
I have to use the commission junction as a affiliator for my upcoming  
project.  
Can anyone point me to correct URL so that I can go through it and  
understand how to do that?

Thanks,  
Mike
