WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

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: Evan Bigall <evan.bigall@xxxxxxxxxxx>
Date: Mon, 02 Apr 2007 17:46:05 -0400
Cc: xen-api@xxxxxxxxxxxxxxxxxxx
Delivery-date: Mon, 02 Apr 2007 14:44:26 -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: <OF16A1740D.3C678028-ON852572B1.0069B614-852572B1.006BAC51@xxxxxxxxxx>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 1.5.0.10 (Windows/20070221)
Apache xmlrpc-3.0, and their internal transport, ie: m_client.setTransportFactory(new XmlRpcCommonsTransportFactory(m_client)).  I had started out using Java's http transport, but ran into problems.  Sorry, can't quite remember what they were.

Evan

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?


  Stefan

>
> I'm pretty sure this all works as expected.
>
> Evan
> Stefan Berger wrote:
> >
> > Evan Bigall <evan.bigall@xxxxxxxxxxx> wrote on 04/02/2007 12:42:01 PM:
> >
> > > I believe the object is a map, here is a code fragment that might help:
> > >
> > >             /*
> > >              Unimplemented...
> > >              Object kernelKernel=execute("VM.get_kernel_kernel",
> > params);
> > >             */
> > >
> > >             java.util.Map result=(java.util.Map)execute("VM.
> > > get_record", params);
> > >
> >
> > For get_record I also get a map, where the 'Value' key itself contains
> > a java.util.Map as value type.
> > Another function that returns a 'Set' is get_by_label_name, which also
> > returns an Object as value to the 'Value' key. Maybe it's the
> > functions that return 'Set's that cannot be deserialized or are not
> > properly serialized ?
> >
> >    Stefan
> >
> >
> > >             /*
> > >             Set keyset=result.keySet();
> > >             for(Object key : keyset) {
> > >                 LOG.debug("XXX key %s value %b \"%s\"\n",
> > >                           (String)key, null==result.get((String)key),
> > >                           result.get((String)key));
> > >             }
> > >             */
> > >
> > >             String kernelKernel=(String)result.get("PV_kernel");
> > > /Evan
> > >
> > > Stefan Berger wrote:
> > >
> > > Hello!
> > >
> > >   I am experimenting with a Java client to access xend through the
> > > Xen-API. Using the Apache XML-RPC library (version 3) I could open a
> > > session that returned the status value and the uuid of the session.
> > > When I try to call VM.get_all() in a subsequent step, the returned
> > > HashMap again contains the status code but as a second parameter a
> > > quite useless Java 'Object' -- not a Vector or so. I see, though,
> > > that Xend returns a list of UUIDs of the managed domains. Is there
> > > any way to have the second parameter become something more useful
> > > like a Vector or a String[] or does another client library do this
> > better?
> > >
> > > Thanks.
> > >
> > >    Stefan
> > >
> > >
> > > _______________________________________________
> > > xen-api mailing list
> > > xen-api@xxxxxxxxxxxxxxxxxxx
> > > http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-api
> > >  
>

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