Tuesday, April 6, 2010

Calling a webservice from ruby

It's pretty dang easy. (We're using our hello world service in this example)
gem install soap4r --include-dependencies

Start up a friendly irb session and type in the following:
>>require "soap/wsdlDriver"
>>wsdl = "http://localhost:3000/hello_world/wsdl"
>>driver = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
>>driver.helloMessage("guest")
=> "Hello guest"

No comments: