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/
Home Products Support Community News


[Xen-API] Where am i going wrong here...

To: xen-api@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-API] Where am i going wrong here...
From: "Shaun R." <mailinglists@xxxxxxxxxxxxxxxx>
Date: Sat, 1 Dec 2007 02:14:52 -0800
Delivery-date: Sat, 01 Dec 2007 02:20:34 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
My first attempt at this, trying to get php to interface with /var/run/xend/xen-api.sock (or even for that matter). I can make a connection to both the unix socket and the inet socket and write/read data. The problem is i always get the same responce back, also the responce back is in html, shouldnt it be in xml format? At the moment this is my code

$fp = fsockopen("unix:///var/run/xend/xen-api.sock", 0, $errno, $errstr, 30);
if (!$fp) {
   echo "$errstr ($errno)\n";
} else {
$request = xmlrpc_encode_request("session.login_with_password", array("root","ndcunix"));
       fwrite($fp, $request."\n");
       while (!feof($fp)) {
               echo fgets($fp, 128);

When i run the code i always get this responce back...

<title>Error response</title>
<h1>Error response</h1>
<p>Error code 400.
<p>Message: Bad request version ('encoding="iso-8859-1"?&gt;').
<p>Error code explanation: 400 = Bad request syntax or unsupported method.

Anybody know why this is happening, also ifi telnet to localhost port 9363 and paste in my own request same thing happens, error looks alittle diferent though..

Connected to localhost.localdomain (
Escape character is '^]'.
<?xml version="1.0" encoding="iso-8859-1"?><methodCall><methodName>session.login_with_password</methodName><params> <param> <value><string>root</string></value></param><param><value><string>password</string></value></param></params></methodCall>
<title>Error response</title>
<h1>Error response</h1>
<p>Error code 400.
<p>Message: Bad request syntax ('&lt;?xml version="1.0" encoding="iso-8859-1"?&gt;&lt;methodCall&gt;&lt;methodName&gt;session.login_with_password&lt;/methodName&gt;&lt;params&gt; &lt;param&gt; &lt;value&gt;&lt;string&gt;root&lt;/string&gt;&lt;/value&gt;&lt;/param&gt;&lt;param&gt;&lt;value&gt;&lt;string&gt;password&lt;/string&gt;&lt;/value&gt;&lt;/param&gt;&lt;/params&gt;&lt;/methodCall&gt;').
<p>Error code explanation: 400 = Bad request syntax or unsupported method.
Connection closed by foreign host.


xen-api mailing list

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-API] Where am i going wrong here..., Shaun R. <=