Xen 
 
Home About Xen.org Xen Xen Summit Wiki Mailing List Bug Tracker Xen Downloads
 
   
 

xen-api

Re: [Xen-API] Java XML RPC with Xen-API?

To: Stefan Berger <stefanb@xxxxxxxxxx>
Subject: Re: [Xen-API] Java XML RPC with Xen-API?
From: Ewan Mellor <ewan@xxxxxxxxxxxxx>
Date: Mon, 2 Apr 2007 22:40:26 +0100
Cc: xen-api@xxxxxxxxxxxxxxxxxxx
Delivery-date: Mon, 02 Apr 2007 14:39:07 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <OF16A1740D.3C678028-ON852572B1.0069B614-852572B1.006BAC51@xxxxxxxxxx>
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
References: <46114270.3070306@xxxxxxxxxxx> <OF16A1740D.3C678028-ON852572B1.0069B614-852572B1.006BAC51@xxxxxxxxxx>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.9i
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.

Ewan.

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-api