开发者

How do I pass objects to RPC style web services when working with soap4r at runtime?

开发者 https://www.devze.com 2022-12-15 19:09 出处:网络
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

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
开发者_Python百科

How do I execute a rpc with a object parameter?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消