Please find the required code below.
<?php
include('xmlrpc.inc');
$server_path = '/egroupware/xmlrpc.php';
$server_hostname = '192.168.0.7';
$server_port = 80;
// Connecting to XmlRPC
$c = new xmlrpc_client($server_path, $server_hostname,
$server_port);
// Authenticating to server
$loginServer = new xmlrpcmsg(‘system.login’, array(new
xmlrpcval(array(
‘domain’ => new xmlrpcval(‘default’, “string”),
‘username’ => new xmlrpcval(‘admin’, “string”),
‘password’ => new xmlrpcval(‘admin’, “string”),
), “struct”)));
$mLogin = $c->send($loginServer);
// Processing Login Output
if(!$mLogin->faultCode()) {
$vLogin = $mLogin->value();
echo “Login Success
”;
$sessIdVal = $vLogin->structmem(‘sessionid’);
$sessId = $sessIdVal ->scalarval();
$kp3Val = $vLogin->structmem(‘kp3’);
$kp3 = $kp3Val ->scalarval();
echo "Session ID: " . $sessId . “
”;
echo “kp3: " . $kp3 . “
”;
}
else{
print “Fault
“;
print “Code: " . htmlentities($mLogin->faultCode()) .
”
” .
“Reason: '” . htmlentities($mLogin->faultString()) .
”’
”;
}
?>
You just need to change the first few lines as per your requirements
javascript:emoticon’:)'
Smile
juerphenwrote:
Hello,
I try to call egroupware-functions from a script, but Iᅵm
struggling with the authentication. Has anybody a sample script (perl
or php or python), which is able to log in and call a function using
the sessionid and kp3? Any comments on this are appreciated as
well…
Using egroupware 1.2.101, php 4.4 and 5.1 (different systems)
Thanks a lot,
Juergen
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers