[phpxmlrpc-devel] [Fwd: XMLRPC Class]
Brought to you by:
ggiunta
|
From: Edd D. <ed...@us...> - 2003-12-16 22:30:43
|
-----Forwarded Message-----
From: Laurent GROUSSET <lau...@te...>
To: ed...@us...
Subject: XMLRPC Class
Date: Tue, 16 Dec 2003 15:03:42 +0100
Hy,
=20
Well i have use your usefull XMLRPC class =E2=80=A6
But i need to specify an idsession to connect to the server.
=20
So i modify you class. You can catch it in the attached file.
=20
I=E2=80=99ve just add this in the xmlrpc_client class :
=20
var $sid=3D'';
=20
function setSessionID($thisSID)
{
$this->sid=3D$thisSID;
}
=20
=20
And this to the sendPayloadHTTP10 methode o:
=20
$credentials=3D'';
if ($username!=3D'')
{
$credentials=3D'Authorization: Basic '
. base64_encode($username . ':' . $password) . "\r\n";
}
=20
if ($this->sid!=3D'')
{
$credentials.=3D'Cookie: sid=3D' .
$this->sid . "\r\n";
}
=20
$op=3D "POST " . $this->path. "
HTTP/1.0\r\nUser-Agent: PHP XMLRPC 1.0\r\n" .
"Host: ". $this->server . "\r\n" .
$credentials .=20
"Content-Type:
text/xml\r\nContent-Length: " .
strlen($msg->payload) . "\r\n\r\n" .
$msg->payload;
=20
I hope i twill be usefull for you.
=20
Best regards.
=20
Laurent
|