[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-users] XenApi

I originally posted this to the xenapi mailing list but i dont think many are on there... here's my question.

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

$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","none"));
       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

Connected to localhost.localdomain (
Escape character is '^]'.
<?xml version="1.0"
<title>Error response</title>
<h1>Error response</h1>
<p>Error code 400.
<p>Message: Bad request syntax ('&lt;?xml version="1.0"
<p>Error code explanation: 400 = Bad request syntax or unsupported method.
Connection closed by foreign host.


Xen-users mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.