-
Notifications
You must be signed in to change notification settings - Fork 52
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 property which is a Collection: System Center 2012 VMM service #26
Comments
Could you also provide me with a gist of the metadata for the service? Just request http://:9090/SC2012/VMM/Microsoft.Management.Odata.svc/$metadata |
Here it is: https://gist.github.com/jhellan/5789199 |
I need the actual resulting feed xml from the query, what is the results of the following query http://:9090/SC2012/VMM/Microsoft.Management.Odata.svc/VirtualMachines?$top=1 (or change the $top to something else, just wanted to limit what you brought back) The resulting XML should start with a |
Hope this helps: https://gist.github.com/jhellan/5789559 |
I checked the fix into the develop branch. There may be another bug however. Could you get me the results of a query that returns an entity where you have a collection of complex types in the results. You'll probably have to eager load one of these. A "complex type" would just be a class that is in the VMM namespace (like VMNetworkAssignment). I want to make sure I have coverage for that scenario now that the the complex type class resolves properly. I suspect it will work, but just want to make sure. |
Thanks. That worked. The following program fails: require 'ruby_odata' svc = OData::Service.new "http://:9090/SC2012/VMM/Microsoft.Management.Odata.svc/", { :username => "blabla", :password=> "", :verify_ssl => false, :namespace => "VMM" } svc.HardwareProfiles.filter("Memory eq 3500") hs = svc.execute The gist https://gist.github.com/jhellan/5791590 contains the result when I do this with curl. I see <category term="VMM.HardwareProfile" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/> The backtrace is /var/lib/gems/1.9.1/gems/ruby_odata-0.1.3/lib/ruby_odata/service.rb:652:in `block in complex_type_to_class': undefined method `element=' for # (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:651:in `complex_type_to_class' from /var/lib/gems/1.9.1/gems/ruby_odata-0.1.3/lib/ruby_odata/service.rb:689: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 ./rb4.rb:9:in `' |
Thanks! That's exactly what I was thinking could been a problem. Try the latest version of the develop branch. |
Works great. Thanks! Jon |
Here's a very simple program that calls the VMM service and fails:
The final statement fails with the following backtrace:
A VirtualMachine entry can be found at https://gist.github.com/jhellan/5781766
I did some tracing, and found that it failed when it got to this property:
This is the first property that is a collection, so I wonder if that could be the reason.
The text was updated successfully, but these errors were encountered: