Ruby Axis2 Web Service

Hi,
I have created Axis2 web service in Java. The service has a method
printComponent which takes object user defined class (PageComponent).
The user defined class has three attributes.

I want to consume this service from ruby. I am not able to figure out
how to pass user defined object to web service method

require ‘soap/rpc/driver’
require ‘cgi’

class PageComponent
def initialize(url, server_time, network_time)
@URL = url
@serverTime = server_time
@networkTime = network_time
end

attr_reader :URL, :serverTime, :networkTime
end

endpoint =
http://localhost:8080/Axis2WebService/services/RandomNumber?wsdl
namespace = ‘http://axis2.qklab.com

soap = SOAP::RPC::Driver.new(endpoint, namespace)
soap.add_method(‘printComponent’,‘component’)
soap.add_method(‘getNumber’)
u = PageComponent.new(“http://www.qualitykiosk.com”,10.0,20.0)
#~ u.URL = “http://www.qualitykiosk.com
#~ u.serverTime = 10.0
#~ u.networkTime = 20.0
#~ p u.networkTime
p soap.getNumber()
parameters = {“uRL” =>‘http://www.qualitykiosk.com’,“serverTime”=> 10.0
, “networkTime” => 20.0}
soap.printComponent(parameters)

Thanks
Krishna Padave

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs