SOAP request with Ruby

I had a hard time finding examples while trying to get code to test a SOAP service with Ruby. Therefore, I thought I would add an example to the Google code repository. In the end I didn't get this working, this is the final work of a developer named Jim Johnson. I got started down the road and Jim came along and finished it up.

require 'soap/element'
require 'soap/rpc/driver'
require 'soap/processor'
require 'soap/streamHandler'
require 'soap/property'

LOCALHOST_ENDPOINT = "http://localhost:8080/services/Service"
request_xml_string = 'xml...'
stream =

header =
body_item ='getResponse', request_xml_string)
body =
envelope =, body)
request_string = SOAP::Processor.marshal(envelope)
request =

resp_data = stream.send(LOCALHOST_ENDPOINT, request, 'getResponse')

puts "Got response:"
puts resp_data.receive_string