I've the following Codeigniter XML RPC code for searching customers in a OpenERP database,
I' following this documentation for implementing search
The below code works fine and retrieves the all the records in res.partner table
$this->xmlrpc->server('http://localhost/xmlrpc/object',8314);
$this->xmlrpc->method('execute');
//$this->xmlrpc->set_debug(TRUE);
$request = array (
array($this->database, 'string'),
array($this->userid , 'int'),
array($this->password, 'string'),
array("res.partner", 'string'),
array('search', 'string'),
array(array(), 'array'),
);
$this->xmlrpc->request($request);
if ( ! $this->xmlrpc->send_request())
{
echo $this->xmlrpc->display_error();
return -1;
}
else
{
//print_r( $this->xmlrpc->display_response());
$val = $this->xmlrpc->display_response();
return $val;
}
Now I want to get only the items with name=abc
$this->xmlrpc->server('http://localhost/xmlrpc/object',8314);
$this->xmlrpc->method('execute');
//$this->xmlrpc->set_debug(TRUE);
$attribute = "name";
$operator = "=";
$keys="abc";
$key = array(
new XML_RPC_Values(array(
new XML_RPC_Values($attribute , "string"),
new XML_RPC_Values($operator,"string"),
new XML_RPC_Values($keys,"string"))
,"array"),
);
$request = array (
array($this->database, 'string'),
array($this->userid , 'int'),
array($this->password, 'string'),
array("res.partner", 'string'),
array('search', 'string'),
$key,
);
$this->xmlrpc->request($request);
if ( ! $this->xmlrpc->send_request())
{
echo $this->xmlrpc->display_error();
return -1;
}
else
{
//print_r( $this->xmlrpc->display_response());
$val = $this->xmlrpc->display_response();
return $val;
}
This is not working and it thowss the following errors
A PHP Error was encountered
Severity: Notice
Message: Object of class XML_RPC_Values could not be converted to int
Filename: libraries/Xmlrpc.php
Line Number: 1216
A PHP Error was encountered
Severity: 4096
Message: Object of class XML_RPC_Values could not be converted to string
Filename: libraries/Xmlrpc.php
Line Number: 1360
the result is same all the records of the res.partner table is retrieved