[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-API] Java XML RPC with Xen-API?
Ewan Mellor <ewan@xxxxxxxxxxxxx> wrote on 04/02/2007 05:40:26 PM: > On Mon, Apr 02, 2007 at 03:37:17PM -0400, Stefan Berger wrote: > > > Evan Bigall <evan.bigall@xxxxxxxxxxx> wrote on 04/02/2007 01:50:40 PM: > > > > > My "execute" method returns result.get("Value"), you should then be able > > > to cast that into a java Set, and iterate through all the key/value > > pairs. > > > > I would hope so, too, but it results in a ClassCastException. Which XML > > RPC library are you using and what version? > > Glancing through the Apache XML-RPC library, version 3, it looks > like you should > either be able to cast that to either an Object [], or failing that, a > List. Xen-API's Sets are marshalled as XML-RPC <array>s on the wire, and > it's up to the client library how to interpret that. > > If you call getClass() on the result, you can see what it's giving you > back. > Here is what is coming back: This first one is for estblishing the session -- works -->{Status=Success, Value=7f0a5d0b-c0ff-f948-36e5-cbad03caf24c} UUID: 7f0a5d0b-c0ff-f948-36e5-cbad03caf24c The VM.get_all returns a 'Set' -- only an Object comes back Calling VM.get_all(7f0a5d0b-c0ff-f948-36e5-cbad03caf24c,...) Returned object = {Status=Success, Value=[Ljava.lang.Object;@1faba46} 'Value' has type class [Ljava.lang.Object; A Map is returned from VM.get_record(): Calling VM.get_record(7f0a5d0b-c0ff-f948-36e5-cbad03caf24c,...) Returned object = {Status=Success, Value={actions_after_suspend=restart, user_version=1, domid=0, memory_static_max=17592186040320, memory_dynamic_min=1048576000, is_control_domain=true, actions_after_shutdown=destroy, resident_on=1e86bcf9-3ddb-406a-4a31-702944839f28, memory_dynamic_max=1048576000, PV_ramdisk=, security_label=sHype:xm-test:SystemManagement, PV_args=, uuid=00000000-0000-0000-0000-000000000000, name_label=Domain-0, PV_kernel=, actions_after_crash=restart, VCPUs_at_startup=4, memory_static_min=0, other_config={}, name_description=Domain-0, PV_bootloader=, auto_power_on=false, consoles=[Ljava.lang.Object;@3570b0, VIFs=[Ljava.lang.Object;@79717e, platform={}, VBDs=[Ljava.lang.Object;@10a2d64, PV_bootloader_args=, metrics=2714b0e7-45b2-8ed3-31db-a31c8237750e, VTPMs=[Ljava.lang.Object;@12a3722, actions_after_reboot=restart, HVM_boot_policy=, tools_version={}, VCPUs_params={cap=0, weight=256}, is_a_template=false, PCI_bus=, HVM_boot_params={}, power_state=Running, VCPUs_max=4}} 'Value' has type class java.util.HashMap A set comes back here: Calling VM.get_by_name_label(7f0a5d0b-c0ff-f948-36e5-cbad03caf24c,...) Returned object = {Status=Success, Value=[Ljava.lang.Object;@cfec48} 'Value' has type class [Ljava.lang.Object; Neither with the normal TranportFactory nor the XmlRpcCommonsTransportFactory (which pulls in an amazing amount of other jars) could I get a better result type... Stefan > Ewan. _______________________________________________ xen-api mailing list xen-api@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-api
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |