[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Ruby SOAP Bug?

Greg Lazarev

6/3/2008 8:54:00 PM

I've spent a few days now looking on how to access a wsdl over ssl.
I'm using Ruby 1.8.6 and SOAP4R 1.5.8
In short, I need to connect to a wsdl file and also need to do the basic
authentication before SOAP::WSDLDriverFactory.new call.
So I created a soap/property file and put the correct information in
there.
I followed this link for a simple ruby program:
http://dev.ctor.org/soap4r/wiki/AccessingBasicAuthPro...

After I set everything up, I started seeing weird errors.
So I debugged an debugged and finally I saw something funky with the
httpconfigloader.rb's set_basic_auth method.
So I googled to see if it's a bug or not and came upon this blog:
http://cubiclecoder.blogspot.com/2005/10/of-aggregators-laptops-ruby-and...

He talks about the same problem I am having with set_basic_auth.
But noone else seems to have this problem.

So what do I do in this case?
Do I submit this as a bug to Ruby guys?
Is this indeed a bug?

I would appreciate any responses.
--
Posted via http://www.ruby-....

6 Answers

vc

6/3/2008 9:27:00 PM

0

Greg Lazarev wrote:

> I would appreciate any responses.

I wrote a blog post a few days ago about how to do this:
http://s2.d...blog/show/62_Consume+SSL+protected+Web+Services+w...
maybe it is of some use to you.

--
http://s2.d...

Greg Lazarev

6/3/2008 10:04:00 PM

0

I actually have looked at your blog as well when developing/debugging.
My coding strategy is pretty much the same as yours.
I'm using
client.protocol.http.ssl_config.verify_mode=OpenSSL::SSL::VERIFY_NONE
option instead of messing with the certificates.

However my problem is that the set_basic_auth function does not treat
the entries in the soap/property file correctly. Basically what happens
is client.set_basic_auth gets called three times with these values:
First time: url, nil, nil
Second time: nil, userid, nil
Third time: nil, nil, password

I find it strange that not more people are seeing this problem.
And since your code is working, I confused why mine is not.
What are your ruby and soap4r versions?
--
Posted via http://www.ruby-....

S2

6/4/2008 7:08:00 AM

0

Greg Lazarev wrote:
> I actually have looked at your blog as well when developing/debugging.

cool :) at least i did not write that post only for me alone :)

> However my problem is that the set_basic_auth function does not treat
> the entries in the soap/property file correctly. Basically what happens
> is client.set_basic_auth gets called three times with these values:
> First time: url, nil, nil
> Second time: nil, userid, nil
> Third time: nil, nil, password

i don't know. this did not happen to me, so i can't help you. sorry.

> I find it strange that not more people are seeing this problem.
> And since your code is working, I confused why mine is not.
> What are your ruby and soap4r versions?

ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
soap4r (1.5.8)

Greg Lazarev

6/4/2008 5:23:00 PM

0

So I think I might have figured out what the problem is.

I looked at the soap4r's httpconfigloader.rb and it handles
set_basic_auth different then ruby's soap/httpconfigloader.rb. I'm
guessing the "bug" is really only in the ruby's version.
I have the soap4r gem installed but I am not using it for some reason.
What is the difference between the ruby's soap and soap4r? They seem
quite similar.
Am I suppose to require something to use the soap4r's version of the
code?

Here's my simple app, by the way:

require 'soap/wsdlDriver'
wsdl = 'https://server/path/to/file.wsdl'
soap = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver

And here's the soap/property file:

client.protocol.http.basic_auth.1.url = https://server/path/to/file.wsdl
client.protocol.http.basic_auth.1.userid = username
client.protocol.http.basic_auth.1.password = password

client.protocol.http.ssl_config.verify_mode=OpenSSL::SSL::VERIFY_NONE
--
Posted via http://www.ruby-....

Greg Lazarev

6/4/2008 6:00:00 PM

0

OK, I was able to solve this by using the soap4r gem. All I did was
added:

gem 'soap4r'

line to the top of my code.
--
Posted via http://www.ruby-....

vc

6/4/2008 7:14:00 PM

0

Greg Lazarev wrote:

> OK, I was able to solve this by using the soap4r gem. All I did was
> added:
>
> gem 'soap4r'
>
> line to the top of my code.

Great. Thanks for sharing.

--
http://s2.d...