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…
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:
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.
If they’re exposing a REST XML service according to Rails
conventions :-), then you can use ActiveResource directly inside of
your Rails app. The interface is similar (but a subset) of
ActiveRecord, so it will feel pretty natural inside of a Rails app.
If it’s a proprietary XML standard, then using something like
XmlSimple (which Rails includes by default) let’s you slurp up an XML
doc into a hash pretty easily, and you can attack it from there.