wsdl2ruby NoMethodError

G

Giedrius

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"?>
<definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="https://zzz/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
targetNamespace="https://zzz/" xmlns="http://schemas.xmlsoap.org/wsdl/">
<types>
<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>
</types>
<message name="GetAllStockSoapIn">
<part name="parameters" element="s0:GetAllStock" />
</message>
<message name="GetAllStockSoapOut">
<part name="parameters" element="s0:GetAllStockResponse" />
</message>
<message name="GetVendorInfoSoapIn">
<part name="parameters" element="s0:GetVendorInfo" />
</message>
<message name="GetVendorInfoSoapOut">
<part name="parameters" element="s0:GetVendorInfoResponse" />
</message>
<message name="GetVendorListSoapIn">
<part name="parameters" element="s0:GetVendorList" />
</message>
<message name="GetVendorListSoapOut">
<part name="parameters" element="s0:GetVendorListResponse" />
</message>
<message name="GetProductGroupsSoapIn">
<part name="parameters" element="s0:GetProductGroups" />
</message>
<message name="GetProductGroupsSoapOut">
<part name="parameters" element="s0:GetProductGroupsResponse" />
</message>
<message name="AddSoapIn">
<part name="parameters" element="s0:Add" />
</message>
<message name="AddSoapOut">
<part name="parameters" element="s0:AddResponse" />
</message>
<message name="GetAllStockHttpGetIn" />
<message name="GetAllStockHttpGetOut">
<part name="Body" element="s0:DataSet" />
</message>
<message name="GetVendorInfoHttpGetIn">
<part name="GamintojoKodas" type="s:string" />
</message>
<message name="GetVendorInfoHttpGetOut">
<part name="Body" element="s0:DataSet" />
</message>
<message name="GetVendorListHttpGetIn" />
<message name="GetVendorListHttpGetOut">
<part name="Body" element="s0:DataSet" />
</message>
<message name="GetProductGroupsHttpGetIn" />
<message name="GetProductGroupsHttpGetOut">
<part name="Body" element="s0:DataSet" />
</message>
<message name="AddHttpGetIn">
<part name="a" type="s:string" />
<part name="b" type="s:string" />
</message>
<message name="AddHttpGetOut">
<part name="Body" element="s0:int" />
</message>
<message name="GetAllStockHttpPostIn" />
<message name="GetAllStockHttpPostOut">
<part name="Body" element="s0:DataSet" />
</message>
<message name="GetVendorInfoHttpPostIn">
<part name="GamintojoKodas" type="s:string" />
</message>
<message name="GetVendorInfoHttpPostOut">
<part name="Body" element="s0:DataSet" />
</message>
<message name="GetVendorListHttpPostIn" />
<message name="GetVendorListHttpPostOut">
<part name="Body" element="s0:DataSet" />
</message>
<message name="GetProductGroupsHttpPostIn" />
<message name="GetProductGroupsHttpPostOut">
<part name="Body" element="s0:DataSet" />
</message>
<message name="AddHttpPostIn">
<part name="a" type="s:string" />
<part name="b" type="s:string" />
</message>
<message name="AddHttpPostOut">
<part name="Body" element="s0:int" />
</message>
<portType name="ProductFunctionsSoap">
<operation name="GetAllStock">
<input message="s0:GetAllStockSoapIn" />
<output message="s0:GetAllStockSoapOut" />
</operation>
<operation name="GetVendorInfo">
<input message="s0:GetVendorInfoSoapIn" />
<output message="s0:GetVendorInfoSoapOut" />
</operation>
<operation name="GetVendorList">
<input message="s0:GetVendorListSoapIn" />
<output message="s0:GetVendorListSoapOut" />
</operation>
<operation name="GetProductGroups">
<input message="s0:GetProductGroupsSoapIn" />
<output message="s0:GetProductGroupsSoapOut" />
</operation>
<operation name="Add">
<input message="s0:AddSoapIn" />
<output message="s0:AddSoapOut" />
</operation>
</portType>
<portType name="ProductFunctionsHttpGet">
<operation name="GetAllStock">
<input message="s0:GetAllStockHttpGetIn" />
<output message="s0:GetAllStockHttpGetOut" />
</operation>
<operation name="GetVendorInfo">
<input message="s0:GetVendorInfoHttpGetIn" />
<output message="s0:GetVendorInfoHttpGetOut" />
</operation>
<operation name="GetVendorList">
<input message="s0:GetVendorListHttpGetIn" />
<output message="s0:GetVendorListHttpGetOut" />
</operation>
<operation name="GetProductGroups">
<input message="s0:GetProductGroupsHttpGetIn" />
<output message="s0:GetProductGroupsHttpGetOut" />
</operation>
<operation name="Add">
<input message="s0:AddHttpGetIn" />
<output message="s0:AddHttpGetOut" />
</operation>
</portType>
<portType name="ProductFunctionsHttpPost">
<operation name="GetAllStock">
<input message="s0:GetAllStockHttpPostIn" />
<output message="s0:GetAllStockHttpPostOut" />
</operation>
<operation name="GetVendorInfo">
<input message="s0:GetVendorInfoHttpPostIn" />
<output message="s0:GetVendorInfoHttpPostOut" />
</operation>
<operation name="GetVendorList">
<input message="s0:GetVendorListHttpPostIn" />
<output message="s0:GetVendorListHttpPostOut" />
</operation>
<operation name="GetProductGroups">
<input message="s0:GetProductGroupsHttpPostIn" />
<output message="s0:GetProductGroupsHttpPostOut" />
</operation>
<operation name="Add">
<input message="s0:AddHttpPostIn" />
<output message="s0:AddHttpPostOut" />
</operation>
</portType>
<binding name="ProductFunctionsSoap" type="s0:productFunctionsSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document" />
<operation name="GetAllStock">
<soap:eek:peration soapAction="https://zzz/GetAllStock"
style="document" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
<operation name="GetVendorInfo">
<soap:eek:peration soapAction="https://zzz/GetVendorInfo"
style="document" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
<operation name="GetVendorList">
<soap:eek:peration soapAction="https://zzz/GetVendorList"
style="document" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
<operation name="GetProductGroups">
<soap:eek:peration soapAction="https://zzz/GetProductGroups"
style="document" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
<operation name="Add">
<soap:eek:peration soapAction="https://zzz/Add" style="document" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
<binding name="ProductFunctionsHttpGet"
type="s0:productFunctionsHttpGet">
<http:binding verb="GET" />
<operation name="GetAllStock">
<http:eek:peration location="/GetAllStock" />
<input>
<http:urlEncoded />
</input>
<output>
<mime:mimeXml part="Body" />
</output>
</operation>
<operation name="GetVendorInfo">
<http:eek:peration location="/GetVendorInfo" />
<input>
<http:urlEncoded />
</input>
<output>
<mime:mimeXml part="Body" />
</output>
</operation>
<operation name="GetVendorList">
<http:eek:peration location="/GetVendorList" />
<input>
<http:urlEncoded />
</input>
<output>
<mime:mimeXml part="Body" />
</output>
</operation>
<operation name="GetProductGroups">
<http:eek:peration location="/GetProductGroups" />
<input>
<http:urlEncoded />
</input>
<output>
<mime:mimeXml part="Body" />
</output>
</operation>
<operation name="Add">
<http:eek:peration location="/Add" />
<input>
<http:urlEncoded />
</input>
<output>
<mime:mimeXml part="Body" />
</output>
</operation>
</binding>
<binding name="ProductFunctionsHttpPost"
type="s0:productFunctionsHttpPost">
<http:binding verb="POST" />
<operation name="GetAllStock">
<http:eek:peration location="/GetAllStock" />
<input>
<mime:content type="application/x-www-form-urlencoded" />
</input>
<output>
<mime:mimeXml part="Body" />
</output>
</operation>
<operation name="GetVendorInfo">
<http:eek:peration location="/GetVendorInfo" />
<input>
<mime:content type="application/x-www-form-urlencoded" />
</input>
<output>
<mime:mimeXml part="Body" />
</output>
</operation>
<operation name="GetVendorList">
<http:eek:peration location="/GetVendorList" />
<input>
<mime:content type="application/x-www-form-urlencoded" />
</input>
<output>
<mime:mimeXml part="Body" />
</output>
</operation>
<operation name="GetProductGroups">
<http:eek:peration location="/GetProductGroups" />
<input>
<mime:content type="application/x-www-form-urlencoded" />
</input>
<output>
<mime:mimeXml part="Body" />
</output>
</operation>
<operation name="Add">
<http:eek:peration location="/Add" />
<input>
<mime:content type="application/x-www-form-urlencoded" />
</input>
<output>
<mime:mimeXml part="Body" />
</output>
</operation>
</binding>
<service name="ProductFunctions">
<port name="ProductFunctionsSoap" binding="s0:productFunctionsSoap">
<soap:address location="https://zzz/XML/product.asmx" />
</port>
<port name="ProductFunctionsHttpGet"
binding="s0:productFunctionsHttpGet">
<http:address location="https://zzz/XML/product.asmx" />
</port>
<port name="ProductFunctionsHttpPost"
binding="s0:productFunctionsHttpPost">
<http:address location="https://zzz/XML/product.asmx" />
</port>
</service>
</definitions>
 
G

Giedrius

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?
 
N

NAKAMURA, Hiroshi

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

Hi,

Sorry for late reply.
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-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top