I am trying to get some data from Odoo through XMLRPC, and I am working with PHP and its Ripcord library (recommended on https://www.odoo.com/documentation/8.0/api_integration.html).
So I am following the steps written on that page.
Firstly, I downloaded the Ripcord files from https://github.com/poef/ripcord.git. I saved them in a folder named ripcord, located at the index directory of my PHP page.
Secondly, I enabled the OpenSSL and XMLRPC extensions for PHP7. I think I did it well because if I execute the next sentence:
$modules = get_loaded_extensions();
foreach ($modules as $module) {
echo $module.', ';
}
I get this result:
Core, date, libxml, openssl, pcre, zlib, filter, hash, Reflection,
SPL, session, standard, apache2handler, mysqlnd, PDO, xml, calendar,
ctype, curl, dom, mbstring, fileinfo, ftp, gd, gettext, iconv, json,
exif, mcrypt, mysqli, pdo_mysql, Phar, posix, readline, shmop,
SimpleXML, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, wddx,
xmlreader, xmlrpc, xmlwriter, xsl, Zend OPcache,
Now, this is the code of my index.php:
$url = 'http://localhost:30080';
$db = 'db_v80_test_01';
$username = 'admin';
$password = 'adminpwd';
require_once('ripcord/ripcord.php');
// $info = ripcord::client($url)->start();
// list($url, $db, $username, $password) = array($info['host'], $info['database'], $info['user'], $info['password']);
$common = ripcord::client($url.'/xmlrpc/2/common');
$uid = $common->authenticate($db, $username, $password, array());
die($uid);
The problem is that I am getting nothing in $uid
variable. Can anyone tell me what is happening?
NOTE
May be this question is duplicated: Odoo API web service doesn't return anything
But as it had no answers, I tried to give more information on mine.
See Question&Answers more detail:
os