Wsdl2ruby NoMethodError


#1

Hi, i’m trying to generate objects for my wsdl and wsdl2ruby comes with
error:

F, [2006-01-30T15:16:20.082000 #3520] FATAL – app: Detected an
exception. Stopping … undefined method `namespace’ for nil:NilClass
(NoMethodError)

any solution for this?

comand line:
ruby wsdl2ruby.rb --wsdl mywsdl.wsdl --type client --force

wsdl is below:

<?xml version="1.0" encoding="utf-8"?>



<s:schema elementFormDefault=“qualified”
targetNamespace=“https://zzz/”>
<s:import namespace=“http://www.w3.org/2001/XMLSchema” />
<s:element name=“GetAllStock”>
<s:complexType />
</s:element>
<s:element name=“GetAllStockResponse”>
<s:complexType>
<s:sequence>
<s:element minOccurs=“0” maxOccurs=“1”
name=“GetAllStockResult”>
<s:complexType>
<s:sequence>
<s:element ref=“s:schema” />
<s:any />
</s:sequence>
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
<s:element name=“GetVendorInfo”>
<s:complexType>
<s:sequence>
<s:element minOccurs=“0” maxOccurs=“1” name=“GamintojoKodas”
type=“s:string” />
</s:sequence>
</s:complexType>
</s:element>
<s:element name=“GetVendorInfoResponse”>
<s:complexType>
<s:sequence>
<s:element minOccurs=“0” maxOccurs=“1”
name=“GetVendorInfoResult”>
<s:complexType>
<s:sequence>
<s:element ref=“s:schema” />
<s:any />
</s:sequence>
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
<s:element name=“GetVendorList”>
<s:complexType />
</s:element>
<s:element name=“GetVendorListResponse”>
<s:complexType>
<s:sequence>
<s:element minOccurs=“0” maxOccurs=“1”
name=“GetVendorListResult”>
<s:complexType>
<s:sequence>
<s:element ref=“s:schema” />
<s:any />
</s:sequence>
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
<s:element name=“GetProductGroups”>
<s:complexType />
</s:element>
<s:element name=“GetProductGroupsResponse”>
<s:complexType>
<s:sequence>
<s:element minOccurs=“0” maxOccurs=“1”
name=“GetProductGroupsResult”>
<s:complexType>
<s:sequence>
<s:element ref=“s:schema” />
<s:any />
</s:sequence>
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
<s:element name=“Add”>
<s:complexType>
<s:sequence>
<s:element minOccurs=“1” maxOccurs=“1” name=“a” type=“s:int”
/>
<s:element minOccurs=“1” maxOccurs=“1” name=“b” type=“s:int”
/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name=“AddResponse”>
<s:complexType>
<s:sequence>
<s:element minOccurs=“1” maxOccurs=“1” name=“AddResult”
type=“s:int” />
</s:sequence>
</s:complexType>
</s:element>
<s:element name=“DataSet” nillable=“true”>
<s:complexType>
<s:sequence>
<s:element ref=“s:schema” />
<s:any />
</s:sequence>
</s:complexType>
</s:element>
<s:element name=“int” type=“s:int” />
</s:schema>




















































































































































<soap:binding transport=“http://schemas.xmlsoap.org/soap/http
style=“document” />

<soap:operation soapAction=“https://zzz/GetAllStock
style=“document” />

<soap:body use=“literal” />


<soap:body use=“literal” />



<soap:operation soapAction=“https://zzz/GetVendorInfo
style=“document” />

<soap:body use=“literal” />


<soap:body use=“literal” />



<soap:operation soapAction=“https://zzz/GetVendorList
style=“document” />

<soap:body use=“literal” />


<soap:body use=“literal” />



<soap:operation soapAction=“https://zzz/GetProductGroups
style=“document” />

<soap:body use=“literal” />


<soap:body use=“literal” />



<soap:operation soapAction=“https://zzz/Add” style=“document” />

<soap:body use=“literal” />


<soap:body use=“literal” />




<http:binding verb=“GET” />

<http:operation location="/GetAllStock" />

<http:urlEncoded />


<mime:mimeXml part=“Body” />



<http:operation location="/GetVendorInfo" />

<http:urlEncoded />


<mime:mimeXml part=“Body” />



<http:operation location="/GetVendorList" />

<http:urlEncoded />


<mime:mimeXml part=“Body” />



<http:operation location="/GetProductGroups" />

<http:urlEncoded />


<mime:mimeXml part=“Body” />



<http:operation location="/Add" />

<http:urlEncoded />


<mime:mimeXml part=“Body” />




<http:binding verb=“POST” />

<http:operation location="/GetAllStock" />

<mime:content type=“application/x-www-form-urlencoded” />


<mime:mimeXml part=“Body” />



<http:operation location="/GetVendorInfo" />

<mime:content type=“application/x-www-form-urlencoded” />


<mime:mimeXml part=“Body” />



<http:operation location="/GetVendorList" />

<mime:content type=“application/x-www-form-urlencoded” />


<mime:mimeXml part=“Body” />



<http:operation location="/GetProductGroups" />

<mime:content type=“application/x-www-form-urlencoded” />


<mime:mimeXml part=“Body” />



<http:operation location="/Add" />

<mime:content type=“application/x-www-form-urlencoded” />


<mime:mimeXml part=“Body” />





<soap:address location=“https://zzz/XML/product.asmx” />


<http:address location=“https://zzz/XML/product.asmx” />


<http:address location=“https://zzz/XML/product.asmx” />



#2

I’ve got it working by my self by removing --force option,

btw could anybody point me, where are all options and their meaning of
wsdl2ruby described?


#3

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Sorry for late reply.

Giedrius wrote:

Hi, i’m trying to generate objects for my wsdl and wsdl2ruby comes with
error:

F, [2006-01-30T15:16:20.082000 #3520] FATAL – app: Detected an
exception. Stopping … undefined method `namespace’ for nil:NilClass
(NoMethodError)

any solution for this?

It’s the bug of soap4r. I fixed it at the subversion repository though
I’m afraid of seeing how wsdl2ruby.rb can handle .NET DataSet. Would
you please try this patch?

Regards,
// NaHi

Index: wsdl/soap/classDefCreator.rb

  • — wsdl/soap/classDefCreator.rb (revision 1680)
    +++ wsdl/soap/classDefCreator.rb (working copy)
    @@ -311,7 +311,7 @@
    init_params << “#{varname} = nil”
    end
    # nil means @@schema_ns + varname
    •    eleqname = element.name || element.ref.name
      
  •    eleqname = element.name || element.ref
       if eleqname && varname == name && eleqname.namespace ==
    

base_namespace
eleqname = nil
end

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)

iD8DBQFECueQf6b33ts2dPkRAjTsAJ9a4d63nnq+1NhTK4fEw2tdRpsYtQCfQyRm
oUmRNpl+NcRpEf4/AD5i36I=
=2Ick
-----END PGP SIGNATURE-----