What you're going to want to use is a library called soap4r, it has
another library called wsdl2ruby.
http://dev.ctor.org/soap4r (read it all, but there is a long list of
good how-to's)
It will generate some files for you that make it easier to consume the
web service...
There should be 4 files and you'll need to require things at the top
of each. I wanted to be able to run my test ruby script as well as my
rails implementation concurrently (well without changing the require
statements every time anyway) so I did something like this...
require File.expand_path(File.dirname(__FILE__) + "../../../config/
environment")
require "#{RAILS_ROOT}/lib/soap/customer_details.rb"
require "#{RAILS_ROOT}/lib/soap/customer_detailsMappingRegistry.rb"
require 'soap/rpc/driver'
class WsGetCustAcctDtls < ::RPC::Driver
Things are put here from wsdl2ruby...
And after that you just need to be able to query your web service.
This is what my WSDLNameClient.rb file (the ruby file that wsdl2ruby
generates) looks like:
http://pastie.textmate.org/private/u1yw8kyfi7ysopnh5mwrzq
The authentication stuff in there was specific to the web service I
was consuming, I had to build up a header and pass it in, etc... it
was a pita.
I'm not an expert, but I did end up getting it working after a lot of
googling and playing around with it. Here is an article that helped
me. but check out all the how-to's in that first link.
http://www.brendonwilson.com/blog/2006/04/02/ruby-soap4r-wsdl-hell/
Hopefully knowing the libraries you're supposed to be using will help
your googling too. Good luck!
-Jon Kinney
Inacom Information Systems
Ruby on Rails Developer