<br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">hd nguyen</b> <span dir="ltr"><<a href="mailto:nguyenhd2107@gmail.com">nguyenhd2107@gmail.com</a>></span><br>
Date: Fri, Dec 18, 2009 at 1:25 AM<br>Subject: Fwd: [one-users] Xmlrpc Lib<br>To: <a href="mailto:user@lists.opennebula.org">user@lists.opennebula.org</a><br><br><br><div><div></div><div class="h5"><div class="gmail_quote">
Thanks for your reply,<br>But the main problem here is when I execute the command "vm.allocate" (which will created a virtual machine description or VMTemplate - if I understand correctly as API <a href="http://opennebula.org/doku.php?id=documentation:rel1.4:api%29" target="_blank">http://opennebula.org/doku.php?id=documentation:rel1.4:api)</a>,<br>


But after this command, I use "onevm list" on ONE installed PC, no VMTemplate found????<br>I don't know why is that!?<br>Regards,<br>DuyNH<div><div></div><div><br><br><div class="gmail_quote">On Fri, Dec 18, 2009 at 12:47 AM, hd nguyen <span dir="ltr"><<a href="mailto:nguyenhd2107@gmail.com" target="_blank">nguyenhd2107@gmail.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div><br><br><div class="gmail_quote">---------- Forwarded message ----------<br>


From: <b class="gmail_sendername">Nikola Milutinovic</b> <span dir="ltr"><<a href="mailto:n.milutinovic@levi9.com" target="_blank">n.milutinovic@levi9.com</a>></span><br>
Date: Thu, Dec 17, 2009 at 4:39 PM<br>Subject: Re: [one-users] Xmlrpc Lib<br>To: hd nguyen <<a href="mailto:nguyenhd2107@gmail.com" target="_blank">nguyenhd2107@gmail.com</a>><br><br><br>


  

<div bgcolor="#ffffff" text="#000000"><div>
hd nguyen wrote:
<blockquote type="cite"><br clear="all">
Hi all,<br>
I have a test Program to test XmlRpc API in Open Nebula as bellow:<br>
  <b>XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();<br>
            config.setServerURL(new URL("<a href="http://192.168.1.41:2633/RPC2" target="_blank">http://192.168.1.41:2633/RPC2</a>"));<br>
            XmlRpcClient client = new XmlRpcClient();<br>
            client.setConfig(config);<br>
  <br>
Vector params = new Vector();           <br>
            
params.addElement("oneadmint:7c4a8d09ca3762af61e59520943dc26494f8941b");<br>
            params.addElement(4);       <br>
           <br>
            Object result = client.execute( "<a href="http://one.host.info" target="_blank">one.host.info</a>", params );<br>
           <br>
                System.out.println(result.getClass().getName());<br>
          <br>
            if ( result != null )<br>
                System.out.println( result.toString() );</b><br>
  <br>
Here is the printed result: <br>
  <b>[Ljava.lang.Obj<br>
ect;@97a560</b><br>
</blockquote>
<br></div>
And that result is correct. The return type of the execute method is
"Object[]", so that is what you should actually cast to.<br>
<br>
Object[] results = (Object[]) client.execute("<a href="http://one.host.info" target="_blank">one.host.info</a>", parms);<br>
if (!((Boolean) results[0])) {<br>
     throw new OneException(results[1].toString());<br>
}<br>
return (results.length > 1) ? results[1] : null;<br>
<br>
Nix.<br>
<div>-- <br>



<div style="font-family: Tahoma,sans-serif; font-size: 8pt; color: black;">
<span style="font-size: 10pt;"> Met vriendelijke groet / Kind regards,<br>
Nikola Milutinovic<br>
Sr Java Developer<br>
Levi9 Global Sourcing<br>
</span>
<hr> <font face="Wingdings" size="3">.</font> <span> Jan van
Goyenkade 8, 1075 HP Amsterdam, The Netherlands</span> <br>
<font face="Wingdings" size="3">(</font> <span>   +31 (0) 20 7547900
ext 2056</span> <br>
<font face="Wingdings" size="3">(</font> <span>   +381 (0) 21 4895800
ext 2056</span> <br>
<font face="Webdings" size="3">È</font> <span>   +381 (0) 64 2202824</span>
<br>
<font face="Wingdings" size="3">*</font> <span>   <a href="mailto:n.milutinovic@Levi9.com" target="_blank">n.milutinovic@Levi9.com</a></span>
<br>
<font face="Webdings" size="3">^</font> <span>   Skype:
nikola.milutinovic</span> <br>
<font face="Webdings" size="3">ü</font> <span>   <a title="http://www.levi9.com/" href="http://www.levi9.com/" target="_blank">www.levi9.com</a></span>
<br>
<span> <br>
Chamber of commerce Levi9 Global Sourcing BV: 34221951<br>
Chamber of commerce Levi9 Global Sourcing Benelux BV: 34224746<br>
</span>
<hr> <span> This e-mail may contain confidential or privileged
information. If you are not (one of) the intended recipient(s), please
notify the sender immediately by reply e-mail and delete this message
and any attachments permanently without retaining a copy. Any review,
disclosure, copying, distribution or taking any action in reliance on
the contents of this e-mail by persons or entities other than the
intended recipient(s) is strictly prohibited and may be unlawful. <br>
<br>
The services of Levi9 are exclusively subject to its general terms and
conditions. These general terms and conditions can be found on <a title="http://www.levi9.com/" href="http://www.levi9.com/" target="_blank">www.levi9.com</a> and a copy will be
promptly submitted to you on your request and free of charge.<br>
</span> </div>
</div>
</div>

</div><br><br clear="all"><br></div></div><div><div></div><div>-- <br>"The love makes the life better"<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>"The love makes the life better"<br>
</div></div></div><br><br clear="all"><br>-- <br>"The love makes the life better"<br>
</div></div></div><br><br clear="all"><br>-- <br>"The love makes the life better"<br>