Hi,
I searched for an example how to use the xmlrpc from perl and did not
find anything.
Is there interesst in an example inside the wiki (should I just add an
article?).
Here is my example, maybe it is of help for someone.
Greetings
tilo
Egroupware has a powerfull XMLRPC interface, but not much documentation
or examples.
After some searching (I did not find any perl examples) and testing,
here a trivial example how to delete an calender entry from egroupware
using the xml rpc, without any error handling.
#!/usr/bin/perl
require RPC::XML;
require RPC::XML::Client;
Connect to egroupware, cookies are enabled
my $client =
RPC::XML::Client->new(‘http://localhost/egroupware/xmlrpc.php’);
$client->useragent->cookie_jar({ file => “$ENV{HOME}/.cookies.txt” });
my $req = RPC::XML::request->new(‘system.login’,
RPC::XML::struct->new({domain => ‘’,username => ‘tilo’, password
=> ‘tilo’}));
my $res = $client->send_request($req);
We can access the result
my $eg_kp3 = $res->value->{kp3};
my $eg_sessionid = $res->value->{sessionid};
We can send a command (delete a entry)
$req = RPC::XML::request->new(‘calendar.bocalendar.delete’,
RPC::XML::int->new($_));
$res = $client->send_request($req);
print " Response string = “.$res->as_string.”\n";
An we can logoff
$req = RPC::XML::request->new(‘system.logout’,
RPC::XML::struct->new({essionid => $eg_sessionid, kp3 => $eg_kp3}));
$res = $client->send_request($req);
–
E-Mail: tilo@levante.de
Internet: http://www.levante.de
Tel: +49 7624 9167-10
Fax: +49 7624 80562
Dr. Levante GmbH & Co.KG - AG Freiburg HRA 411471
phG: Dr. Levante Beteiligungs GmbH - AG Freiburg HRB 413364
Geschäftsführer: Dr. Tilo Levante, Brunhilde Asal Levante
Sitz: Hauptstrasse 46, 79639 Grenzach-Wyhlen, Deutschland