views:

47

answers:

1

I am creating a proxy for a soap web service at runtime using soap4r.

proxy = SOAP::WSDLDriverFactory.new("http://www.example.com/endpoint?wsdl).create_rpc_driver

How do I execute a rpc with a object parameter?

Any examples would be very helpful.

Thanks.

A: 

I found the answer to my question. Let's say I have an RPC style web service with the following signature:

result SaveProduct(Product product)

I can execute that with soap4r:

proxy = SOAP::WSDLDriverFactory.new("http://www.example.com/endpoint?wsdl").create_rpc_driver
proxy.SaveProduct(:Product => {:name => 'product one', :cost => '12.50'})

Having spent some time with soap4r, I would recommend using wsdl2ruby.rb to generate the proxy objects if possible.

Lee