Forum: Ruby Ruby SOAP WSDL client call not working?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Moazam Raja (Guest)
on 2007-04-18 21:47
(Received via mailing list)
Hi all, I am testing out SOAP/WSDL interaction between Ruby and a
webservice written in Java. I am able to test the Java webservice via
a Java client and get a proper response back, but for whatever reason
I use Ruby to call my webservice, I get a null SOAP Mapping Object
returned back to me.

My Ruby code which is calling the webservice is as follows,

require 'soap/wsdlDriver'
wsdl ='http://localhost:8080/helloservice-war/HelloServic...
driver =
   String myString = 'pookieMon'
   puts "Your answer = %s"  % driver.sayHello(myString)
   puts driver.sayHello(nil)

I'm trying two different 'puts' statements, just in case. I noticed by
looking at my server logs that Ruby is not even passing an argument to
the webservice and hence is not getting anything back either.

Here is what Ruby sends,

<env:Envelope xmlns:env=""

Here is what my Java code sends (and is successful),

<?xml version="1.0" encoding="UTF-8"?>
<S:Envelope xmlns:S="">
<ns2:sayHello xmlns:ns2="http://endpoint.helloservice/">

What's going on here, am I just making a very obvious simple mistake
or does the Ruby soap/wsdlDriver work differently? I'm a Ruby (and


Moazam Raja (Guest)
on 2007-04-19 09:19
(Received via mailing list)
I figured out my earlier problem, here is the solution to talking to
my own Java webservice via WSDL,

# main.rb
# April 18, 2007
require 'soap/wsdlDriver'

wsdl ='http://localhost:8080/helloservice-war/HelloServic...
driver =

   sayHelloResponse = driver.sayHello(:arg0 => 'pookieMon')
   puts sayHelloResponse.return

Earlier, the two main problems were,

1.) I was doing 'sayHelloResponse = driver.sayHello('pookieMon')',
but that kept sending a null to my webservice. I had to change this
to 'sayHelloResponse = driver.sayHello(:arg0 => 'pookieMon')'.

2.) I kept getting a SOAP Message Object returned as a result and had
to use object.inspect to get the actual message. Turns out the
returning XML returns the result String in a <return>String</return>
format. The solution is to call the return method via Object.return.


This topic is locked and can not be replied to.