[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Ruby SOAP WSDL client call not working?

Moazam Raja

4/18/2007 5:47:00 PM

1 Answer

Moazam Raja

4/19/2007 5:19:00 AM

0

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/HelloService?wsdl'
driver = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_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.

Thanks.

-Moazam