On Feb 5, 12:10=A0am, Marcin Gryszkalis <m... / fork.pl> wrote:
> Hi
> I have soap server that has WSDL with request containing
>
> <xsd:element name=3D"mode" type=3D"ons:ModeT" />
>
> where ModeT is defined as
>
> =A0 =A0 =A0 =A0 =A0 =A0 <xsd:simpleType name=3D"ModeT">
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 <xsd:restriction base=3D"xsd:token">
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 <xsd:enumeration value=3D"abc"/>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 <xsd:enumeration value=3D"xyz"/>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 </xsd:restriction>
> =A0 =A0 =A0 =A0 =A0 =A0 </xsd:simpleType>
>
> I created client using
> SOAP::WSDLDriverFactory.new(*).create_rpc_driver
> and it fails with
>
> /usr/lib/ruby/1.8/soap/mapping/wsdlencodedregistry.rb:151:in `base2soap': =
undefined method `<=3D' for nil:NilClass (NoMethodError)
> =A0 =A0 =A0 =A0 from /usr/lib/ruby/1.8/soap/mapping/wsdlencodedregistry.rb=
:127:in `simpleobj2soap'
> =A0 =A0 =A0 =A0 from /usr/lib/ruby/1.8/soap/mapping/wsdlencodedregistry.rb=
:118:in `obj2typesoap'
> =A0 =A0 =A0 =A0 from /usr/lib/ruby/1.8/soap/mapping/wsdlencodedregistry.rb=
:44:in `obj2soap'
> =A0 =A0 =A0 =A0 from /usr/lib/ruby/1.8/soap/mapping/mapping.rb:127:in `_ob=
j2soap'
> =A0 =A0 =A0 =A0 from /usr/lib/ruby/1.8/soap/mapping/wsdlencodedregistry.rb=
:210:in `elements2soap'
> =A0 =A0 =A0 =A0 from /usr/lib/ruby/1.8/soap/mapping/wsdlencodedregistry.rb=
:206:in `each'
> =A0 =A0 =A0 =A0 from /usr/lib/ruby/1.8/soap/mapping/wsdlencodedregistry.rb=
:206:in `elements2soap'
> =A0 =A0 =A0 =A0 from /usr/lib/ruby/1.8/soap/mapping/wsdlencodedregistry.rb=
:167:in `struct2soap'
> =A0 =A0 =A0 =A0 =A0... 18 levels...
>
> changing xsd:token to xsd:string in client fixes problem (but It won't be
> easy to force such change in oryginal WSDL).
>
> Is it just a bug in soap4r, is there anything I could fix on my side?

What version of soap4r are you using? The one that comes with Ruby is
buggy. Try grabbing the latest (1.5.8) if you haven't done so already.