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

Problem with collection (Edm.String) #27

Closed
jhellan opened this issue Jun 19, 2013 · 3 comments
Closed

Problem with collection (Edm.String) #27

jhellan opened this issue Jun 19, 2013 · 3 comments
Assignees
Labels

Comments

@jhellan
Copy link

jhellan commented Jun 19, 2013

One more bug, backtrace looks a lot like the first one:

require 'ruby_odata'
svc = OData::Service.new "http://:9090/SC2012/VMM/Microsoft.Management.Odata.svc/", { :username => "blabla", :password=> "", :verify_ssl => false, :namespace => "VMM" }
svc.VMTemplates
ts = svc.execute

Backtrace:

/var/lib/gems/1.9.1/gems/ruby_odata-0.1.3/lib/ruby_odata/service.rb:655:in `block in complex_type_to_class': undefined method `new' for nil:NilClass (NoMethodError)
    from /var/lib/gems/1.9.1/gems/nokogiri-1.5.6/lib/nokogiri/xml/node_set.rb:239:in `block in each'
    from /var/lib/gems/1.9.1/gems/nokogiri-1.5.6/lib/nokogiri/xml/node_set.rb:238:in `upto'
    from /var/lib/gems/1.9.1/gems/nokogiri-1.5.6/lib/nokogiri/xml/node_set.rb:238:in `each'
    from /var/lib/gems/1.9.1/gems/ruby_odata-0.1.3/lib/ruby_odata/service.rb:654:in `complex_type_to_class'
    from /var/lib/gems/1.9.1/gems/ruby_odata-0.1.3/lib/ruby_odata/service.rb:707:in `parse_value'
    from /var/lib/gems/1.9.1/gems/ruby_odata-0.1.3/lib/ruby_odata/service.rb:393:in `block in entry_to_class'
    from /var/lib/gems/1.9.1/gems/nokogiri-1.5.6/lib/nokogiri/xml/node_set.rb:239:in `block in each'
    from /var/lib/gems/1.9.1/gems/nokogiri-1.5.6/lib/nokogiri/xml/node_set.rb:238:in `upto'
    from /var/lib/gems/1.9.1/gems/nokogiri-1.5.6/lib/nokogiri/xml/node_set.rb:238:in `each'
    from /var/lib/gems/1.9.1/gems/ruby_odata-0.1.3/lib/ruby_odata/service.rb:391:in `entry_to_class'
    from /var/lib/gems/1.9.1/gems/ruby_odata-0.1.3/lib/ruby_odata/service.rb:359:in `block in build_classes_from_result'
    from /var/lib/gems/1.9.1/gems/nokogiri-1.5.6/lib/nokogiri/xml/node_set.rb:239:in `block in each'
    from /var/lib/gems/1.9.1/gems/nokogiri-1.5.6/lib/nokogiri/xml/node_set.rb:238:in `upto'
    from /var/lib/gems/1.9.1/gems/nokogiri-1.5.6/lib/nokogiri/xml/node_set.rb:238:in `each'
    from /var/lib/gems/1.9.1/gems/ruby_odata-0.1.3/lib/ruby_odata/service.rb:358:in `build_classes_from_result'
    from /var/lib/gems/1.9.1/gems/ruby_odata-0.1.3/lib/ruby_odata/service.rb:306:in `handle_collection_result'
    from /var/lib/gems/1.9.1/gems/ruby_odata-0.1.3/lib/ruby_odata/service.rb:102:in `execute'
    from ./rb6.rb:9:in `'
gist showing what curl returns for VMTemplates: https://gist.github.com/jhellan/5814120

It fails when calling '@classes[klass_name].new' on "CD" in context:

        <d:BootOrder m:type="Collection(Edm.String)">
          <d:element>CD</d:element>

Looks like it is trying to instantiate the strings in the 'Collection(Edm.String)' as VMM.String, but failing.

@ghost ghost assigned visoft Jun 19, 2013
@visoft
Copy link
Owner

visoft commented Jun 20, 2013

Give the latest version of the develop branch a try.

@jhellan
Copy link
Author

jhellan commented Jun 20, 2013

That fixes it. Thanks!

@visoft
Copy link
Owner

visoft commented Jun 20, 2013

Great, glad to hear it!

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

No branches or pull requests

2 participants