Help with SOAP4R and a simple complex type

I am trying to do a remote call with SOAP4R (loading a WSDL), the signature has a parameter of this complex type

   <complexType name="ArrayOfstring">
     <complexContent>
       <restriction base="soapenc:Array">
         <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]"/>
       </restriction>
     </complexContent>
   </complexType>

Passing a Ruby array of strings is not working. I am not 100% sure that parameter is the guilty, but I'd bet a dinner :-).

Should I do something special to build and pass an objetc for that complex type?

-- fxn

I reply to myself for the sake of the archives.

Thanks to a blog entry[*] from someone who I own a beer, I learnt that you need to download the soap4r tarball. In the tarball there is a utility called wsdl2ruby.rb. I executed

   ruby wsdl2ruby.rb --wsdl wsdl_url --type client

and got a few Ruby files that represent the service and its metadata. In particular you get a driver named like the service:

   require 'defaultDriver'

   # MyService is generated by wsdl2ruby.rb
   serv = MyService.new

   # ArrayOfstring is defined as child of Array by wsdl2ruby.rb
   ros = ArrayOfstring.new
   ros << "foo"

   # my_method receives an ArrayOfstring
   result = serv.my_method(ros)

It works like a charm!

-- fxn

[*] http://thebogles.com/blog/2005/12/09/

···

On Jun 15, 2006, at 19:27, Xavier Noria wrote:

I am trying to do a remote call with SOAP4R (loading a WSDL), the signature has a parameter of this complex type

  <complexType name="ArrayOfstring">
    <complexContent>
      <restriction base="soapenc:Array">
        <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string"/>
      </restriction>
    </complexContent>
  </complexType>

Passing a Ruby array of strings is not working. I am not 100% sure that parameter is the guilty, but I'd bet a dinner :-).

Should I do something special to build and pass an objetc for that complex type?