I am currently trying to develope an extension in Typo3 which can
connect to EGroupware and synchronize users table with the
addressbook. Once completed, I intend to publish the extension and
continue working upon other aspects of synchronization between Typo3
and EGroupware.
The problem is, I have successfully logged in from the client. But,
somehow my code for synchronizing with the addressbook doesn’t work.
Please find the code below.
The error I receive is “Fatal error: Call to a member function
serialize() on a non-object in C:\Program
Files\xampp\htdocs\test\xmlrpc.inc on line 2673”
Any help will be highly appreciated.
Regards
<?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()) .
”’
";
}
// Fetching values from Addressbook
$m = new xmlrpcmsg(‘addressbook.boaddressbook.search’, array(new
xmlrpcval(array(
‘start’ => new xmlrpcval(‘1’, “int”),
‘limit’ => new xmlrpcval(‘20’, “int”),
‘fields’ => array(new
xmlrpcval(array(‘fn’,‘tel_cell’), “array”)),
‘query’ => new xmlrpcval(’’, “string”),
‘filter’ => new xmlrpcval(‘none’,
“string”),
‘sort’ => new xmlrpcval(‘fn’, “string”),
‘order’ => new xmlrpcval(’’, “string”),
‘sort’ => new xmlrpcval(‘ASC’, “string”),
‘include_users’ => new xmlrpcval(‘all’, “string”)
), “struct”))
);
$r = $c->send($m);
if (!$r->faultCode()) {
$v = $r->value();
echo ‘Addressbook data fetch success
’;
}
else {
print “Fault
“;
print “Code: " . htmlentities($r->faultCode()) .
”
” .
“Reason: '” . htmlentities($r->faultString()) .
”’
";
}
$logoutServer = new xmlrpcmsg(‘system.logout’, array(new
xmlrpcval(array(
‘sessionid’ => new xmlrpcval($sessId,
“string”),
‘kp3’ => new xmlrpcval($kp3,
“string”),
), “struct”)
)
);
$mLogout = $c->send($logoutServer);
if(!$mLogout->faultCode()) {
$vLogin = $mLogin->value();
echo “You are logged out of EGroupware
”;
}
else{
print “Fault
“;
print “Code: " . htmlentities($mLogin->faultCode()) .
”
” .
“Reason: '” . htmlentities($mLogin->faultString()) .
”’
";
}
?>
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