savonrb / wasabi

A simple WSDL parser
MIT License
90 stars 84 forks source link

NoMethodError: undefined method `attribute' for nil:NilClass (reopen savon#299) #14

Closed uxp closed 12 years ago

uxp commented 12 years ago

This is nearly the same exact issue as reported here: rubiii/savon#299

Using: savon v0.9.14 wasabi v2.5.0 nokogiri v1.5.5

From WSDL defined here: https://services.forrent.com/service.wsdl (view source, it transfers as text/html)

irb(main):002:0> client = Savon::Client.new "https://services.forrent.com/service.wsdl"
[... snip...]
irb(main):003:0> client.wsdl.soap_actions
W, [2012-08-06T11:48:07.490548 #39775]  WARN -- : HTTPI executes HTTP GET using the net_http adapter
NoMethodError: undefined method `attribute' for nil:NilClass
        from /Users/uxp/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/wasabi-2.5.0/lib/wasabi/parser.rb:156:in `input_for'
        from /Users/uxp/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/wasabi-2.5.0/lib/wasabi/parser.rb:92:in `block in parse_operations'
        from /Users/uxp/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/nokogiri-1.5.5/lib/nokogiri/xml/node_set.rb:239:in `block in each'
        from /Users/uxp/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/nokogiri-1.5.5/lib/nokogiri/xml/node_set.rb:238:in `upto'
        from /Users/uxp/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/nokogiri-1.5.5/lib/nokogiri/xml/node_set.rb:238:in `each'
        from /Users/uxp/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/wasabi-2.5.0/lib/wasabi/parser.rb:81:in `parse_operations'
        from /Users/uxp/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/wasabi-2.5.0/lib/wasabi/parser.rb:50:in `parse'
        from /Users/uxp/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/wasabi-2.5.0/lib/wasabi/document.rb:132:in `parse'
        from /Users/uxp/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/wasabi-2.5.0/lib/wasabi/document.rb:118:in `parser'
        from /Users/uxp/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/wasabi-2.5.0/lib/wasabi/document.rb:61:in `soap_actions'
        from (irb):3
        from /Users/uxp/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/cli.rb:434:in `console'
        from /Users/uxp/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/vendor/thor/task.rb:22:in `run'
        from /Users/uxp/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
        from /Users/uxp/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/vendor/thor.rb:263:in `dispatch'
        from /Users/uxp/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/vendor/thor/base.rb:386:in `start'
        from /Users/uxp/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/bin/bundle:13:in `<top (required)>'
        from /Users/uxp/.rbenv/versions/1.9.3-p125/bin/bundle:19:in `load'
        from /Users/uxp/.rbenv/versions/1.9.3-p125/bin/bundle:19:in `<main>'
uxp commented 12 years ago

Downgrading Wasabi to 2.1.1 (~> 2.1.0) works, fwiw. That pulls in Savon v1.1.0.

Trying to downgrade Wasabi to 2.2.0 (~> 2.2.0), which pulls Savon v1.0.0, also fails. ~> 2.3.0 and ~> 2.4.0 also fail.

vduglued commented 12 years ago

Exactly the same thing here with

Ruby 1.8.7 Rails 2.3.3 Savon 1.1.0 Wasabi 2.5.0 Nokogiri 1.5.5 HTTPI 1.1.1

cwise commented 12 years ago

+1

Same issue here. Using Savon 1.1.0 and Wasabi 2.5.0. The kicker is that the client's WSDL just changed and introduced this problem.

rubiii commented 12 years ago

i just released v2.5.1 with a fix for this issue. please upgrade and let me know if it works for you. sorry this took so long.