# WSDL parse failure (ruby 1.8.1-preview2, soap4r-1\_5\_1)

**URL:** <https://rubytalk.org/t/wsdl-parse-failure-ruby-1-8-1-preview2-soap4r-1-5-1/8718>\
**Category:** ruby-talk\
**Created:** [7 November 2003 01:19 UTC](https://rubytalk.org/t/wsdl-parse-failure-ruby-1-8-1-preview2-soap4r-1-5-1/8718 "2003-11-07T01:19:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brian\_Marick](https://avatars.discourse-cdn.com/v4/letter/b/5f8ce5/32.png) [@Brian\_Marick](https://rubytalk.org/u/Brian_Marick)\
**Post date:** [7 November 2003 01:19 UTC](https://rubytalk.org/t/wsdl-parse-failure-ruby-1-8-1-preview2-soap4r-1-5-1/8718/1 "2003-11-07T01:19:22Z")

</div>

The Ruby wsdl library doesn’t seem to be able to parse the  
GoogleSearch.wsdl file ([http://api.google.com/GoogleSearch.wsdl](http://api.google.com/GoogleSearch.wsdl)).

I am using ruby 1.8.1-preview2. This problem happens both with the  
pre-installed wsdl code and the code from soap4r-1\_5\_1.

Here’s the symptom when I run the googleSearch/wsdlDriver example  
from Soap4r:

Unknown attr {[http://schemas.xmlsoap.org/wsdl/](http://schemas.xmlsoap.org/wsdl/)}arrayType.  
Unknown attr {[http://schemas.xmlsoap.org/wsdl/](http://schemas.xmlsoap.org/wsdl/)}arrayType.  
/usr/local/lib/ruby/1.8/soap/encodingstyle/soapHandler.rb:396:in  
`decode_tag_by_wsdl': undefined method`namespace’ for nil:NilClass  
(NoMethodError)  
from /usr/local/lib/ruby/1.8/soap/encodingstyle/soapHandler.rb:179:in  
`decode_tag' from /usr/local/lib/ruby/1.8/soap/parser.rb:184:in`decode\_tag’  
from /usr/local/lib/ruby/1.8/soap/parser.rb:132:in `start_element' from /usr/local/lib/ruby/1.8/xsd/xmlparser/parser.rb:78:in`start\_element’  
from /usr/local/lib/ruby/1.8/xsd/xmlparser/rexmlparser.rb:45:in  
`tag_start' from /usr/local/lib/ruby/1.8/rexml/parsers/streamparser.rb:17:in`parse’  
from /usr/local/lib/ruby/1.8/rexml/document.rb:166:in `parse_stream' from /usr/local/lib/ruby/1.8/xsd/xmlparser/rexmlparser.rb:38:in`do\_parse’  
from /usr/local/lib/ruby/1.8/soap/parser.rb:100:in `parse' from /usr/local/lib/ruby/1.8/soap/processor.rb:47:in`unmarshal’  
from /usr/local/lib/ruby/1.8/soap/wsdlDriver.rb:366:in `invoke' from /usr/local/lib/ruby/1.8/soap/wsdlDriver.rb:301:in`rpc\_send’  
from (eval):2:in `doGoogleSearch’  
from trial.rb:19

Those “Unknown attr” messages come from …/lib/ruby/wsdl/parser.rb in  
decode\_tag. A few puts’s make me think that this part of the WSDL  
provokes them:

```
   <xsd:complexType name="ResultElementArray">
     <xsd:complexContent>
       <xsd:restriction base="soapenc:Array">
          <xsd:attribute ref="soapenc:arrayType" 

```

wsdl:arrayType=“typens:ResultElement[]”/\>  
\</xsd:restriction\>  
\</xsd:complexContent\>  
\</xsd:complexType\>

```
   <xsd:complexType name="DirectoryCategoryArray">
     <xsd:complexContent>
       <xsd:restriction base="soapenc:Array">
          <xsd:attribute ref="soapenc:arrayType" 

```

wsdl:arrayType=“typens:DirectoryCategory[]”/\>  
\</xsd:restriction\>  
\</xsd:complexContent\>  
\</xsd:complexType\>

(I deduced this by printing out the name and attrs in  
start\_element. One element that seems to cause the error prints as:  
xsd:attribute  
wsdl:arrayTypetypens:DirectoryCategory[]refsoapenc:arrayType

Plus, the above two elements are the only ones that contain  
"arrayType".)

Unfortunately, I am scandalously ignorant when it comes to SOAP and  
WSDL and all that, so I’m not sure where to take this next. Can  
someone offer a clue?

> **···**
>
> * * *
> 
> Brian Marick  
> Consulting, training, contracting, and research  
> Focused on the intersection of testing, programming, and design  
> [marick@testing.com](mailto:marick@testing.com), [marick@visibleworkings.com](mailto:marick@visibleworkings.com)  
> [www.testing.com](http://www.testing.com), [www.visibleworkings.com](http://www.visibleworkings.com)

---

<div class="post-metadata">

**Author:** ![NAKAMURA\_Hiroshi4](https://avatars.discourse-cdn.com/v4/letter/n/3ab097/32.png) [@NAKAMURA\_Hiroshi4](https://rubytalk.org/u/NAKAMURA_Hiroshi4)\
**Post date:** [7 November 2003 01:42 UTC](https://rubytalk.org/t/wsdl-parse-failure-ruby-1-8-1-preview2-soap4r-1-5-1/8718/2 "2003-11-07T01:42:21Z")

</div>

Hi,

> From: “Brian Marick” [marick@testing.com](mailto:marick@testing.com)  
> Sent: Friday, November 07, 2003 10:19 AM

> The Ruby wsdl library doesn’t seem to be able to parse the  
> GoogleSearch.wsdl file ([http://api.google.com/GoogleSearch.wsdl](http://api.google.com/GoogleSearch.wsdl)).

Thank you for the report. My fault. I redefined “arrayType” in  
wrong namespace in soap4r/1.5.1 (and I skipped Google WSDL test…)  
For short-term workaround, try this patch to lib/wsdl/xmlSchema/data.rb  
This definition should be moved to lib/wsdl/data.rb in the next release.

Regards,  
// NaHi

Index: data.rb

> **···**
>
> ===================================================================  
> RCS file: /src/ruby/lib/wsdl/xmlSchema/data.rb,v  
> retrieving revision 1.2  
> diff -u -2 -p -r1.2 data.rb  
> — data.rb 29 Sep 2003 07:27:57 -0000 1.2  
> +++ data.rb 7 Nov 2003 01:37:01 -0000  
> @@ -37,5 +37,5 @@ module XMLSchema  
> AllName = XSD::QName.new(XSD::Namespace, ‘all’)  
> AnyName = XSD::QName.new(XSD::Namespace, ‘any’)  
> -ArrayTypeAttrName = XSD::QName.new(XSD::Namespace, ‘arrayType’)  
> +ArrayTypeAttrName = XSD::QName.new(Namespace, ‘arrayType’)  
> AttributeName = XSD::QName.new(XSD::Namespace, ‘attribute’)  
> ChoiceName = XSD::QName.new(XSD::Namespace, ‘choice’)

---

<div class="post-metadata">

**Author:** ![Brian\_Marick](https://avatars.discourse-cdn.com/v4/letter/b/5f8ce5/32.png) [@Brian\_Marick](https://rubytalk.org/u/Brian_Marick)\
**Post date:** [7 November 2003 21:14 UTC](https://rubytalk.org/t/wsdl-parse-failure-ruby-1-8-1-preview2-soap4r-1-5-1/8718/3 "2003-11-07T21:14:28Z")

</div>

Thank you very much. It worked fine.

I’m writing an article on how testers can use Ruby to explore web  
services. You can be sure that I’ll mention that my bug report received  
a patch 23 minutes after I submitted it. That’s an important part of  
the reason why testers need to use tools like Ruby.

> **···**
>
> On Thursday, November 6, 2003, at 07:42 PM, NAKAMURA, Hiroshi wrote:
> 
> > Hi,
> > 
> > > From: “Brian Marick” [marick@testing.com](mailto:marick@testing.com)  
> > > Sent: Friday, November 07, 2003 10:19 AM
> > 
> > > The Ruby wsdl library doesn’t seem to be able to parse the  
> > > GoogleSearch.wsdl file ([http://api.google.com/GoogleSearch.wsdl](http://api.google.com/GoogleSearch.wsdl)).
> > 
> > Thank you for the report. My fault. I redefined “arrayType” in  
> > wrong namespace in soap4r/1.5.1 (and I skipped Google WSDL test…)  
> > For short-term workaround, try this patch to lib/wsdl/xmlSchema/data.rb  
> > This definition should be moved to lib/wsdl/data.rb in the next  
> > release.
> > 
> > Regards,  
> > // NaHi
> > 
> > # Index: data.rb
> > 
> > RCS file: /src/ruby/lib/wsdl/xmlSchema/data.rb,v  
> > retrieving revision 1.2  
> > diff -u -2 -p -r1.2 data.rb  
> > — data.rb 29 Sep 2003 07:27:57 -0000 1.2  
> > +++ data.rb 7 Nov 2003 01:37:01 -0000  
> > @@ -37,5 +37,5 @@ module XMLSchema  
> > AllName = XSD::QName.new(XSD::Namespace, ‘all’)  
> > AnyName = XSD::QName.new(XSD::Namespace, ‘any’)  
> > -ArrayTypeAttrName = XSD::QName.new(XSD::Namespace, ‘arrayType’)  
> > +ArrayTypeAttrName = XSD::QName.new(Namespace, ‘arrayType’)  
> > AttributeName = XSD::QName.new(XSD::Namespace, ‘attribute’)  
> > ChoiceName = XSD::QName.new(XSD::Namespace, ‘choice’)
> 
> * * *
> 
> Brian Marick  
> Consulting, training, contracting, and research  
> Focused on the intersection of testing, programming, and design  
> [marick@testing.com](mailto:marick@testing.com), [marick@visibleworkings.com](mailto:marick@visibleworkings.com)  
> [www.testing.com](http://www.testing.com), [www.visibleworkings.com](http://www.visibleworkings.com)
