Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

bug in baseparser.rb

#3701

Hello,

I'm a beginner with ruby on rails. Running ruby 1.8.7 (2008-08-11 patchlevel 72) [i586-linux] on a SUSE 11.1. At the moment I'm playing around with SOAP-based webservices and rails. Today I tried to generate the ruby client files to access the webservice. Therefore I used wsdl2ruby with the following wsdl file

<?xml version='1.0' encoding='utf-8'?>
<wsdl:definitions 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
xmlns:xs="http://www.w3.org/2001/XMLSchema" 
xmlns:xml="http://www.w3.org/XML/1998/namespace">
...
</wsdl:definitions>

and got the following error message

~/RoR/soaptest> wsdl2ruby.rb --wsdl MyNewDiagram-BPMS.wsdl --type client
F, [2010-01-15T21:42:19.601856 #4294] FATAL -- app: Detected an exception. Stopping ... The 'xml' prefix must not be bound to any other namespace (http://www.w3.org/TR/REC-xml-names/#ns-decl)
Line:
Position:
Last 80 unconsumed characters:
 <wsdl:types> <xs:schema targetNamespace="http://www.example.org/MyNe (REXML::ParseException)
/usr/lib/ruby/1.8/rexml/parsers/baseparser.rb:375:in `pull'
...

The critical line in the wsdl file is
xmlns:xml="http://www.w3.org/XML/1998/namespace" after deleting it, everything works perfect. (but thats no option for the project I'm working on)

The error is thrown by /usr/lib/ruby/1.8/rexml/parsers/baseparser.rb at line 372

 attrs.each { |a,b,c,d,e| 
   if b == "xmlns"
   if c == "xml"
# changed by me for debugging
puts "Value of b: "+b
puts "Value of c: "+c
puts "Value of d: "+d
puts "Value of e: "+e
# end of my changes
  if d != "http://www.w3.org/XML/1998/namespace"
    msg = "The 'xml' prefix must not be bound to any other namespace "+
    "(http://www.w3.org/TR/REC-xml-names/#ns-decl)"
    raise REXML::ParseException.new( msg, @source, self )
  end

after I modified this file I get the following output

wsdl2ruby.rb --wsdl MyNewDiagram-BPMS.wsdl --type client
Value of b: xmlns
Value of c: xml
Value of d: "
Value of e: http://www.w3.org/XML/1998/namespace
F, [2010-01-15T21:42:19.601856 #4294] FATAL -- app: Detected an exception. Stopping ... The 'xml' prefix must not be bound to any other namespace (http://www.w3.org/TR/REC-xml-names/#ns-decl)
...

So I think there is an error in:

if d != "http://www.w3.org/XML/1998/namespace"

If I change it to
if e != "http://www.w3.org/XML/1998/namespace"

it works.

Hopefully someone can verify that bug (or tell me that I'm an idiot ;-))

Thanks in advance
Lars

Reported by lars.wittmar · January 15th, 2010 @ 10:08 PM

State: invalid
Milestone: none
Assigned to: Ryan Bigg Ryan Bigg
Importance: Low

Activity

  1. lars.wittmar
    lars.wittmar
    • Tag set to ruby 1.8.7, rexml

    January 15th, 2010 @ 10:20 PM

  2. David Trasbo
    David Trasbo
    • Assigned user set to Ryan Bigg

    Unrelated to Rails. Can be marked as invalid.

    April 15th, 2010 @ 08:57 PM

  3. Ryan Bigg
    Ryan Bigg
    • State changed from new to invalid

    Please submit a bug on the Ruby Redmine for this if still applicable.

    April 15th, 2010 @ 10:47 PM