This project is archived and is in readonly mode.

bug in baseparser.rb
Reported by lars.wittmar | January 15th, 2010 @ 10:08 PM
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
Comments and changes to this ticket
- 
            
         lars.wittmar January 15th, 2010 @ 10:20 PM- Tag set to ruby 1.8.7, rexml
 
- 
         David Trasbo April 15th, 2010 @ 08:57 PM- Assigned user set to Ryan Bigg
 Unrelated to Rails. Can be marked as invalid. 
- 
         Ryan Bigg April 15th, 2010 @ 10:47 PM- State changed from new to invalid
 Please submit a bug on the Ruby Redmine for this if still applicable. 
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
 lars.wittmar
      lars.wittmar
 Ryan Bigg
      Ryan Bigg