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

Can not get it to work (xsd import within the wsdl) #624

Closed
messinadm opened this issue Oct 3, 2014 · 3 comments
Closed

Can not get it to work (xsd import within the wsdl) #624

messinadm opened this issue Oct 3, 2014 · 3 comments

Comments

@messinadm
Copy link

messinadm commented Oct 3, 2014

I'm getting a similar error as closed issue 549 (#549)

irb(main):024:0* client = Savon.client( wsdl: wsdl_location, log: true, log_level: :debug, pretty_print_xml: true)
=> #<Savon::Client:0x4c289660 @wsdl=#<Wasabi::Document:0x7ca89faf @document="https://test-env.<domain>/fmax/wsdl/fmax-wsdl.wsdl", @request=#<HTTPI::Request:0x228bda19 @follow_redirect=false>, @adapter=nil>, @globals=#<Savon::GlobalOptions:0xb9bb107 @option_type=:global, @options={:encoding=>"UTF-8", :soap_version=>1, :namespaces=>{}, :logger=>#<Logger:0x210e215c @logdev=#<Logger::LogDevice:0x26b02ff8 @filename=nil, @shift_age=nil, @dev=#<IO:fd 1>, @mutex=#<Logger::LogDevice::LogDeviceMutex:0x791d569f @mon_count=0, @mon_mutex=#<Mutex:0x75221ed7>, @mon_owner=nil>, @shift_size=nil>, @formatter=nil, @progname=nil, @default_formatter=#<Logger::Formatter:0x1316f155 @datetime_format=nil>, @level=0>, :log=>true, :filters=>[], :pretty_print_xml=>true, :raise_errors=>true, :strip_namespaces=>true, :convert_response_tags_to=>#<Proc:0x473e0d3d@/home/eagles/.rbenv/versions/jruby-1.7.15/lib/ruby/gems/shared/gems/savon-2.7.2/lib/savon/options.rb:85 (lambda)>, :convert_attributes_to=>#<Proc:0x3ad74455@/home/eagles/.rbenv/versions/jruby-1.7.15/lib/ruby/gems/shared/gems/savon-2.7.2/lib/savon/options.rb:86 (lambda)>, :multipart=>false, :adapter=>nil, :use_wsa_headers=>false, :no_message_tag=>false, :follow_redirects=>false, :wsdl=>"https://test-env.<domain>/fmax/wsdl/fmax-wsdl.wsdl"}>>

irb(main):025:0> client.operations
D, [2014-10-02T17:05:52.442000 #18970] DEBUG -- : HTTPI GET request to test-env.<domain> (net_http)
NoMethodError: undefined method `element_children' for nil:NilClass
    from /home/eagles/.rbenv/versions/jruby-1.7.15/lib/ruby/gems/shared/gems/wasabi-3.3.1/lib/wasabi/parser.rb:318:in `output_for'
    from /home/eagles/.rbenv/versions/jruby-1.7.15/lib/ruby/gems/shared/gems/wasabi-3.3.1/lib/wasabi/parser.rb:149:in `parse_operations'
    from /home/eagles/.rbenv/versions/jruby-1.7.15/lib/ruby/gems/shared/gems/nokogiri-1.6.3.1-java/lib/nokogiri/xml/node_set.rb:237:in `each'
    from org/jruby/RubyInteger.java:133:in `upto'
    from /home/eagles/.rbenv/versions/jruby-1.7.15/lib/ruby/gems/shared/gems/nokogiri-1.6.3.1-java/lib/nokogiri/xml/node_set.rb:236:in `each'
    from /home/eagles/.rbenv/versions/jruby-1.7.15/lib/ruby/gems/shared/gems/wasabi-3.3.1/lib/wasabi/parser.rb:137:in `parse_operations'
    from /home/eagles/.rbenv/versions/jruby-1.7.15/lib/ruby/gems/shared/gems/wasabi-3.3.1/lib/wasabi/parser.rb:60:in `parse'
    from /home/eagles/.rbenv/versions/jruby-1.7.15/lib/ruby/gems/shared/gems/wasabi-3.3.1/lib/wasabi/document.rb:161:in `parse'
    from /home/eagles/.rbenv/versions/jruby-1.7.15/lib/ruby/gems/shared/gems/wasabi-3.3.1/lib/wasabi/document.rb:147:in `parser'
    from /home/eagles/.rbenv/versions/jruby-1.7.15/lib/ruby/gems/shared/gems/wasabi-3.3.1/lib/wasabi/document.rb:64:in `soap_actions'
    from /home/eagles/.rbenv/versions/jruby-1.7.15/lib/ruby/gems/shared/gems/savon-2.7.2/lib/savon/client.rb:28:in `operations'
    from (irb):25:in `evaluate'
    from org/jruby/RubyKernel.java:1101:in `eval'
    from org/jruby/RubyKernel.java:1501:in `loop'
    from org/jruby/RubyKernel.java:1264:in `catch'
    from org/jruby/RubyKernel.java:1264:in `catch'
    from /home/eagles/.rbenv/versions/jruby-1.7.15/bin/irb:13:in `(root)'

irb(main):026:0> Savon::VERSION
=> "2.7.2"

irb(main):027:0> JRUBY_VERSION
=> "1.7.15"

After following the relevant links, it looked to me as if the fix from 549 shouldn't be affecting the versions I'm using. Another difference I notice is my wsdl is behind https vs http.

Would greatly appreciate any thoughts on this.

@messinadm
Copy link
Author

messinadm commented Oct 3, 2014

Doesn't seem to be jruby specific as I recreated it with ruby 1.9.3p547. This makes me think it's something with https or the wsdl. I did utilize the wsdl with soapUI. Note that the schema is not embedded in the wsdl, but is imported.

#Section importing schema

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import namespace="http://maximus.com/assetworks/fmax-web-services" schemaLocation="https://test-env.<domain>/fmax/wsdl/fmax-web-services.xsd"/>
</xs:schema 

Here's irb showing the same behavior with mri

irb(main):020:0> RUBY_VERSION
=> "1.9.3"

irb(main):018:0> client = Savon.client( wsdl: wsdl_location, log: true, log_level: :debug, pretty_print_xml: true)
=> #<Savon::Client:0x0000000335f630 @globals=#<Savon::GlobalOptions:0x0000000335f568 @option_type=:global, @options={:encoding=>"UTF-8", :soap_version=>1, :namespaces=>{}, :logger=>#<Logger:0x0000000335f450 @progname=nil, @level=0, @default_formatter=#<Logger::Formatter:0x0000000335f388 @datetime_format=nil>, @formatter=nil, @logdev=#<Logger::LogDevice:0x0000000335f298 @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<IO:<STDOUT>>, @mutex=#<Logger::LogDevice::LogDeviceMutex:0x0000000335f270 @mon_owner=nil, @mon_count=0, @mon_mutex=#<Mutex:0x0000000335f180>>>>, :log=>true, :filters=>[], :pretty_print_xml=>true, :raise_errors=>true, :strip_namespaces=>true, :convert_response_tags_to=>#<Proc:0x0000000335f108@/home/eagles/.rbenv/versions/1.9.3-p547/lib/ruby/gems/1.9.1/gems/savon-2.7.2/lib/savon/options.rb:85 (lambda)>, :convert_attributes_to=>#<Proc:0x0000000335f068@/home/eagles/.rbenv/versions/1.9.3-p547/lib/ruby/gems/1.9.1/gems/savon-2.7.2/lib/savon/options.rb:86 (lambda)>, :multipart=>false, :adapter=>nil, :use_wsa_headers=>false, :no_message_tag=>false, :follow_redirects=>false, :wsdl=>"https://test-env.<domain>/fmax/wsdl/fmax-wsdl.wsdl"}>, @wsdl=#<Wasabi::Document:0x0000000335e550 @document="https://test-env.<domain>/fmax/wsdl/fmax-wsdl.wsdl", @adapter=nil, @request=#<HTTPI::Request:0x0000000335e370 @follow_redirect=false>>>
irb(main):019:0> client.operations
D, [2014-10-02T18:41:49.957444 #8678] DEBUG -- : HTTPI GET request to test-env.<domain> (net_http)
NoMethodError: undefined method `element_children' for nil:NilClass
    from /home/eagles/.rbenv/versions/1.9.3-p547/lib/ruby/gems/1.9.1/gems/wasabi-3.3.1/lib/wasabi/parser.rb:318:in `output_for'
    from /home/eagles/.rbenv/versions/1.9.3-p547/lib/ruby/gems/1.9.1/gems/wasabi-3.3.1/lib/wasabi/parser.rb:149:in `block in parse_operations'
    from /home/eagles/.rbenv/versions/1.9.3-p547/lib/ruby/gems/1.9.1/gems/nokogiri-1.6.3.1/lib/nokogiri/xml/node_set.rb:237:in `block in each'
    from /home/eagles/.rbenv/versions/1.9.3-p547/lib/ruby/gems/1.9.1/gems/nokogiri-1.6.3.1/lib/nokogiri/xml/node_set.rb:236:in `upto'
    from /home/eagles/.rbenv/versions/1.9.3-p547/lib/ruby/gems/1.9.1/gems/nokogiri-1.6.3.1/lib/nokogiri/xml/node_set.rb:236:in `each'
    from /home/eagles/.rbenv/versions/1.9.3-p547/lib/ruby/gems/1.9.1/gems/wasabi-3.3.1/lib/wasabi/parser.rb:137:in `parse_operations'
    from /home/eagles/.rbenv/versions/1.9.3-p547/lib/ruby/gems/1.9.1/gems/wasabi-3.3.1/lib/wasabi/parser.rb:60:in `parse'
    from /home/eagles/.rbenv/versions/1.9.3-p547/lib/ruby/gems/1.9.1/gems/wasabi-3.3.1/lib/wasabi/document.rb:161:in `parse'
    from /home/eagles/.rbenv/versions/1.9.3-p547/lib/ruby/gems/1.9.1/gems/wasabi-3.3.1/lib/wasabi/document.rb:147:in `parser'
    from /home/eagles/.rbenv/versions/1.9.3-p547/lib/ruby/gems/1.9.1/gems/wasabi-3.3.1/lib/wasabi/document.rb:64:in `soap_actions'
    from /home/eagles/.rbenv/versions/1.9.3-p547/lib/ruby/gems/1.9.1/gems/savon-2.7.2/lib/savon/client.rb:28:in `operations'
    from (irb):19
    from /home/eagles/.rbenv/versions/1.9.3-p547/bin/irb:12:in `<main>'

@messinadm
Copy link
Author

And the documentation helps me solve this....

Savon currently does not support WSDL imports, so in case your service imports its type definitions from another file, the element_form_default value might be wrong. ...

savonrb/wasabi#1

@messinadm messinadm changed the title Can not get it to work (using JRuby 1.7.15 and Savon 2.7.2) Can not get it to work (xsd import within the wsdl) Oct 3, 2014
@tjarratt
Copy link
Contributor

tjarratt commented Oct 9, 2014

Hey @messinadm I'm sorry you had to go to such great lengths to discover that this doesn't currently work in Savon.

Based on the amount of support requests we get to do this, it would be really awesome to fix this. Alas, the reality is that I don't have enough time to do it myself, and the feature is large enough that none of the people that have started to fix it ever made enough progress to consider it "fixed" and submit a pull request.

Honestly, I'd be happy to get partial support for WSDLs with imports.

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