Hi guys,
Here is a part of my code (part o my class):
@soaps<<SOAP::WSDLDriverFactory.new("http://#{@Address}:#{@wsPort}/#{wsdl}").create_rpc_driver()
def method_missing(m,*args)
@soaps.each do |soap|
begin
result = soap.send("#{m}",*args)
return result
rescue NoMethodError
end
end
raise NoMethodError
puts m
end
I invoke soap.send by passing #{m} (as a WS method name) and *args are
arguments of the method which are ruby primitives (int, float, string
etc.)
But the problem is that WebServices will change and instead of
primitives their methods will get WSDL objects i.e. like that:
<complexType name="Group">
<sequence>
<element name="id" type="xsd:int"/>
<element name="inherited" type="xsd:boolean"/>
<element name="name" nillable="true" type="soapenc:string"/>
<element name="parentGroupId" type="xsd:int"/>
<element name="priority" type="xsd:int"/>
<element name="roleId" type="xsd:int"/>
</sequence>
</complexType>
How to create such object in ruby. What library can I use?
Any help will be helful
Thanks in advance
···
--
Posted via http://www.ruby-forum.com/.
Have you tried wsdl2ruby script, this will create you a fully functioning
ruby wsdl client ?
···
On 8/31/07, Marcin Tyman <m.tyman@interia.pl> wrote:
Hi guys,
Here is a part of my code (part o my class):
@soaps<<SOAP::WSDLDriverFactory.new("http://#{@Address
}:#{@wsPort}/#{wsdl}").create_rpc_driver()
def method_missing(m,*args)
@soaps.each do |soap|
begin
result = soap.send("#{m}",*args)
return result
rescue NoMethodError
end
end
raise NoMethodError
puts m
end
I invoke soap.send by passing #{m} (as a WS method name) and *args are
arguments of the method which are ruby primitives (int, float, string
etc.)
But the problem is that WebServices will change and instead of
primitives their methods will get WSDL objects i.e. like that:
<complexType name="Group">
<sequence>
<element name="id" type="xsd:int"/>
<element name="inherited" type="xsd:boolean"/>
<element name="name" nillable="true" type="soapenc:string"/>
<element name="parentGroupId" type="xsd:int"/>
<element name="priority" type="xsd:int"/>
<element name="roleId" type="xsd:int"/>
</sequence>
</complexType>
How to create such object in ruby. What library can I use?
Any help will be helful
Thanks in advance
--
Posted via http://www.ruby-forum.com/\.
Lee Irving wrote:
Have you tried wsdl2ruby script, this will create you a fully
functioning
ruby wsdl client ?
No, I haven't. But I found out about it. Ehm... We'll see how it works.
Thanks for answer.
···
--
Posted via http://www.ruby-forum.com/\.
Lee Irving wrote:
Have you tried wsdl2ruby script, this will create you a fully
functioning
ruby wsdl client ?
can you explain how to use it. Because I realized that wsdl2ruby.rb
contains only class definition and there is no documentation for it.
···
--
Posted via http://www.ruby-forum.com/\.
Hi,
Lee Irving wrote:
> Have you tried wsdl2ruby script, this will create you a fully
> functioning
> ruby wsdl client ?
can you explain how to use it. Because I realized that wsdl2ruby.rb
contains only class definition and there is no documentation for it.
There should be a wsdl2ruby script, but AFAIK it's not usually distributed.
This is what I do:
require 'wsdl/soap/wsdl2ruby'
wsdl = WSDL:
:WSDL2Ruby.new
wsdl.location = "wsdl/data/ps/ps.wsdl"
wsdl.opt['force'] = true
wsdl.opt['classdef'] = "wsdl/ps"
wsdl.opt['module_path'] = "PS"
wsdl.opt['mapping_registry'] ||= nil
wsdl.opt['driver'] ||= nil
wsdl.run
You can ask for more information in:
http://groups.google.com/group/soap4r
···
On 9/3/07, Marcin Tyman <m.tyman@interia.pl> wrote:
--
Felipe Contreras