Forum: Ruby on Rails webservice consumption over SSL

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ab457a1472a803502ebbabb9a811d2d9?d=identicon&s=25 Giedrius Banaitis (Guest)
on 2006-01-30 11:17
(Received via mailing list)
Hi, as long as nobody answered to my previous question, i'll try to
write in another way.
I have:
webservice WSDL link (https://something?WSDL, that's .net webservice)
pem file (certificate, needed to authentificate for gettting data)

i need :
to consume that webservice without describing API's for each method (i
mean use WSL to construct needed structures or objects).

condition:
use as litle lines of code as possible :)
btw, i would prefer solution, that would work on standart ruby
instalation (without additional installs, is that possible)

i've tried by my self SOAP::WSDLFactoryDriver, but that didn't worked
correct (may be because of the lack of information about working using
SSL,
but looks like problem is more serious - it didn't recognized some xml
elements in .net standart webservice WSDL description)
C319ec7828874b714f89fdb2200de905?d=identicon&s=25 Ben Myles (Guest)
on 2006-01-30 12:16
(Received via mailing list)
I didn't see your previous message, so I hope I understand your
question correctly.

Look at http://dev.ctor.org/soap4r/wiki/HowtouseWSDL4R to see how to
generate Ruby classes from the WSDL files. Make sure you're using the
latest stable SOAP4R (or even trunk).

Just set your endpoint to the https location:
https://my.web.service/service.cgi (or whatever extension asp.net
uses).

If your server has a self-generated certificate you'll need to set a
few more options:

    @service_type =
ServiceType.new("https://my.web.service/service.cgi")
    @service_type.options["protocol.http.ssl_config.verify_mode"] = nil

And, if you also need to authenticate with http basic authentication:

    @service_type.options["protocol.http.basic_auth"] <<
["https://my.web.service/service.cgi" "username", "password"]

Finally, when you generate the Ruby classes from the WSDL files, you
will receive a 'Client.rb' class for each type. Have a look at that
for examples on consuming the web services.

Hope that helps a bit?

Ben
Ab457a1472a803502ebbabb9a811d2d9?d=identicon&s=25 Giedrius (Guest)
on 2006-01-30 14:36
Thanks a lot, i've seen that example before, but only now i've payed
attention, that they are using wsdl2ruby first :)
anyway, now i'm having problems with wsdl2ruby, it comes with
NoMethodError :(
This topic is locked and can not be replied to.