开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜