Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add || {} to @types[base] in parser.rb #423

Closed
freakyfelt opened this issue Apr 1, 2013 · 4 comments
Closed

Add || {} to @types[base] in parser.rb #423

freakyfelt opened this issue Apr 1, 2013 · 4 comments
Milestone

Comments

@freakyfelt
Copy link

When attempting to call "operations" on a WSDL client I am getting a TypeError:

auth_client = Savon.client(ssl_verify_mode: :none, wsdl: 'https://path/to/Service?wsdl')
auth_client.operations
D, [2013-03-31T21:14:02.335141 #5965] DEBUG -- : HTTPI GET request to [REDACTED] (net_http)
TypeError: can't convert nil into Hash
    from gems/wasabi-3.0.0/lib/wasabi/parser.rb:131:in `merge!'
    from gems/wasabi-3.0.0/lib/wasabi/parser.rb:131:in `block (2 levels) in process_type'
    from gems/wasabi-3.0.0/lib/wasabi/parser.rb:138:in `call'
    from gems/wasabi-3.0.0/lib/wasabi/parser.rb:138:in `each'
    from gems/wasabi-3.0.0/lib/wasabi/parser.rb:138:in `parse_deferred_types'
    from gems/wasabi-3.0.0/lib/wasabi/parser.rb:51:in `parse'
    from gems/wasabi-3.0.0/lib/wasabi/document.rb:132:in `parse'
    from gems/wasabi-3.0.0/lib/wasabi/document.rb:118:in `parser'
    from gems/wasabi-3.0.0/lib/wasabi/document.rb:61:in `soap_actions'
    from gems/savon-2.1.0/lib/savon/client.rb:30:in `operations'
    from (irb):16

Looking in the source it looks like @types[base] in this case was nil. Adding an || {} to the end of the merge argument fixed it.

# lib/wasabi/parser.rb:131
# before:
            deferred_types << Proc.new { @types[name].merge! @types[base] }
# after:
            deferred_types << Proc.new { @types[name].merge!(@types[base] || {}) }
@rubiii
Copy link
Contributor

rubiii commented Apr 1, 2013

could you provide the wsdl for testing?

@freakyfelt
Copy link
Author

@rubiii
Copy link
Contributor

rubiii commented Apr 5, 2013

thanks. you're right. wasabi has a problem with undefined xml element extensions.
the element is probably defined inside the imported schema, but wasabi doesn't support that. #340.

i'll add a fix for this.

@rubiii
Copy link
Contributor

rubiii commented Apr 21, 2013

this has been fixed on master and will be released with v2.2.0.

@rubiii rubiii closed this as completed Apr 21, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants