SOAP client in Ruby/Rails

Hi all. I have a need to build a SOAP client using Ruby and Rails. I’m
accessing a document/literal style SOAP service. I’ve been poring over
documentation (well, there really doesn’t seem to be any, so that’s a
little misleading), blog posts, and outdated tutorials all day, and I
still don’t really have anywhere to begin. Every tutorial seems to
have a vastly different idea of how to do this, and most of them call
for the use of classes or methods which seem to no longer exist. The
SOAP4R rdocs as well as the docs for the SOAP stuff built into Ruby
are almost completely empty. They list methods that the classes
define, but remain frustratingly silent on what they’re for or how to
use them.

I need a foothold here. Does anyone have any pointers to decent, not-
outdated documents on getting started with SOAP as a client? Also,
does anyone know if the SOAP stuff in Ruby does document/literal, or
is it RPC only? I’ve read that SOAP4R can do it, but of course it’s
not documented, so I have no clue how to begin.

I could really use a lifeline here if someone has one to toss me.

Thanks,
-Bill

I just had the most unfortunate experience of writing a SOAP client in
Ruby

require ‘soap/wsdlDriver’
class VideosController < ApplicationController
def send_soap
XSD::Charset.encoding = ‘UTF8’
wsdlfile = “http://dev.espn.go.com:3004/test/test.xml
driver = SOAP::WSDLDriverFactory.new(wsdlfile).create_rpc_driver
driver.addAsset(false,“siteId”, “contentUploaderId”,
“contentUploaderUsername”, “contentUploaderIp”, “#{@video.class.name}-
#{@video.id}”, “fileTitle”, “filePath”, “contentType”,
“contentSubtype”, “publicUri”)
end
end

Where addAsset is the name of the method you want to call.

SOAP is a terrible thing – that’s why you don’t find much
documentation on it.

Thanks for the code sample. Does that WSDLDriver to support document/
literal, do you know?

And I agree with your take on SOAP. Unfortunately my hands are tied,
I’m integrating with Google’s AdSense API, and it’s all SOAPy. :frowning:

-Bill

On May 22, 6:45 pm, “[email protected]” <ESPN3.DL-

So have you gotten anywhere with this?

I want to make a google adsense checker, so that on my admin page I
can show current adsense earnings, etc.

Any code help would be great.