[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Demexp-dev] Cookie..
From: |
Diogene Laerce |
Subject: |
[Demexp-dev] Cookie.. |
Date: |
Sat, 22 Sep 2007 13:25:46 +0700 |
Hi David,
Sorry but I didnt have much time this week, so here am I :
I tried your python approach but I must have missed something. Heres the
code:
__________________________________________________________________________
<?php
include 'xmlrpc.inc';
$server = new
xmlrpc_client("http://www.linux-france.org/cgi-bin/demexp-xmlrpc-demo");
$server->setDebug(1);
$login = new xmlrpcval("root", "string");
$passwd = new xmlrpcval("demexp", "string");
$message = new xmlrpcmsg("login", array($login, $passwd));
$result = $server->send($message);
// Process the response.
if (!$result)
{
print "<p>Could not connect to HTTP server.</p>";
}
elseif ($result->faultCode())
{
print "<p>XML-RPC Fault #" . $result->faultCode() . ": " .
$result->faultString();
}
else
{
$cookie = $result->value();
if(!empty($cookie))
{
echo 'Valeur du cookie=>'.$cookie;
}
}
________________________________________________________________
It return a :
Catchable fatal error: Object of class xmlrpcval could not be converted
to string
In second hand, I saw this in the "xmlrpc2.2 for php" doc :
______________________________________________________________
$client->setCookie($name, $value, $path, $domain, $port);
string $name;
string $value;
string $path;
string $domain;
int $port;
}
______________________________________________________________
This should be used to set a cookie to send back to the server for
dialog purpose. So I ve got quesstions on that :
Is the $name should be the "id + pwd" string ?
Is the $value the int value returned by the server ?
And what about the $path, $domain and $port, should I use them or not ?
And if so : what are they ?
So a lot of questions wich I dont have the answer.. If you can tell me
what do you think about that.
Yours
Diogene
PS : The server response debug :
---GOT---
HTTP/1.0 200 OK
Date: Sat, 22 Sep 2007 06:09:32 GMT
Content-Length: 129
Content-Type: text/xml
Server: Apache/1.3.33 (Unix) PHP/4.3.11 mod_perl/1.29
<?xml version='1.0'?>
<methodResponse>
<params>
<param>
<value><int>332720051</int></value>
</param>
</params>
</methodResponse>
---END---
HEADER: date: Sat, 22 Sep 2007 06:09:32 GMT
HEADER: content-length: 129
HEADER: content-type: text/xml
HEADER: server: Apache/1.3.33 (Unix) PHP/4.3.11 mod_perl/1.29
---PARSED---
xmlrpcval::__set_state(array(
'me' =>
array (
'int' => 332720051,
),
'mytype' => 1,
'_php_class' => NULL,
))
---END---
- [Demexp-dev] Cookie..,
Diogene Laerce <=