Odoo中文社区可以通过以下三个域名访问:shine-it.net , odoocn.org,odoo.net.cn

原论坛用户的基本信息和发帖这里都予以保留,请注意:原论坛用户无需重新注册新用户,但是您的密码需要重置

开发人员可以登录gitter讨论组: http://gitter.im/odoo-china/Talk, 需要github账号

如果您登录系统碰到问题,请在微信公众号留言:

求助: odoo8 xmlrpc接口中php编程需要调用ripcord库,调用失败



  • 环境: ubuntu12.04  odoo8 php5 <br />官方说明是:<br />Note<br /><br />These examples use the Ripcord library, which provides a simple XML-RPC API. Ripcord requires that XML-RPC support be enabled in your PHP installation.<br /><br />Since calls are performed over HTTPS, it also requires that the OpenSSL extension be enabled<br /><br />于是:<br />sudo apt-get install php5-xmlrpc <br />sudo apt-get install openssl<br />sudo apt-get install libssl-dev<br />sudo apt-get install libssl0.9.8<br />sudo apt-get install libgtk2.0-dev<br /><br /><br /><!DOCTYPE html><br /><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><br /><html><br /><body><br /><br /><h1>odoo php api test</h1><br /><br /><?php<br />echo "Hello World!0.1";<br />require_once('ripcord.php');<br />$url = "http://10.0.10.219:8069";<br />echo "Hello World!0";<br />$db = "flaginfo";<br />$username = "admin";<br />$password = "111111";<br />echo "Hello World!1";<br />$models = ripcord::client("$url/xmlrpc/2/object");<br /><br />echo "Hello World!3";<br />?><br /><br /></body><br /></html><br /><br /><br />运行结果:<br />odoo php api test<br />Hello World!0.1<br /><br />调用失败。 这个如何定位问题?



  • 环境: ubuntu12.04  odoo8 php5 <br />官方说明是:<br />Note<br /><br />These examples use the Ripcord library, which provides a simple XML-RPC API. Ripcord requires that XML-RPC support be enabled in your PHP installation.<br /><br />Since calls are performed over HTTPS, it also requires that the OpenSSL extension be enabled<br /><br />于是:<br />sudo apt-get install php5-xmlrpc <br />sudo apt-get install openssl<br />sudo apt-get install libssl-dev<br />sudo apt-get install libssl0.9.8<br />sudo apt-get install libgtk2.0-dev<br /><br /><br /><!DOCTYPE html><br /><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><br /><html><br /><body><br /><br /><h1>odoo php api test</h1><br /><br /><?php<br />echo "Hello World!0.1";<br />require_once('ripcord.php');<br />$url = "http://10.0.10.219:8069";<br />echo "Hello World!0";<br />$db = "flaginfo";<br />$username = "admin";<br />$password = "111111";<br />echo "Hello World!1";<br />$models = ripcord::client("$url/xmlrpc/2/object");<br /><br />echo "Hello World!3";<br />?><br /><br /></body><br /></html><br /><br /><br />运行结果:<br />odoo php api test<br />Hello World!0.1<br /><br />调用失败。 这个如何定位问题?



  • [attachurl=1] <br /><br /><br />[code]<br /><?php<br />//exit(phpinfo());<br /><br />echo "Hello World!0.1";<br />require_once('lib\ripcord.php');<br />$url = "http://119593-8-0-eb993b.runbot.odoo.com/";<br />echo "Hello World!0";<br />$db = "119593-8-0-eb993b-all";<br />$username = "admin";<br />$password = "admin";<br />echo "Hello World!1";<br />$models = ripcord::client("$url/xmlrpc/2/object");<br />var_dump($models);<br /><br />echo "Hello World!3";<br />?><br />[/code]<br /><br /><br />[code]<br /><br /><br />Hello World!0.1Hello World!0Hello World!1object(Ripcord_Client)#2 (12) {<br />  ["_url:private"]=><br />  string(57) "http://119593-8-0-eb993b.runbot.odoo.com//xmlrpc/2/object"<br />  ["_transport:private"]=><br />  object(Ripcord_Transport_Stream)#1 (2) {<br />    ["options:private"]=><br />    array(0) {<br />    }<br />    ["responseHeaders"]=><br />    NULL<br />  }<br />  ["_outputOptions:private"]=><br />  array(5) {<br />    ["output_type"]=><br />    string(3) "xml"<br />    ["verbosity"]=><br />    string(6) "pretty"<br />    ["escaping"]=><br />    array(1) {<br />      [0]=><br />      string(6) "markup"<br />    }<br />    ["version"]=><br />    string(6) "xmlrpc"<br />    ["encoding"]=><br />    string(5) "utf-8"<br />  }<br />  ["_namespace:private"]=><br />  NULL<br />  ["_rootClient:private"]=><br />  RECURSION<br />  ["_cloneObjects:private"]=><br />  bool(false)<br />  ["_multiCall:protected"]=><br />  bool(false)<br />  ["_multiCallArgs:protected"]=><br />  array(0) {<br />  }<br />  ["_response"]=><br />  string(0) ""<br />  ["_request"]=><br />  string(0) ""<br />  ["_throwExceptions"]=><br />  bool(false)<br />  ["_autoDecode"]=><br />  bool(true)<br />}<br />Hello World!3<br />[/code]<br /><br /><br /><br />测试完全没有问题.....<br />



  • [quote author=mrshelly link=topic=17439.msg31611#msg31611 date=1450161290]<br />[attachurl=1] <br /><br /><br />[code]<br /><?php<br />//exit(phpinfo());<br /><br />echo "Hello World!0.1";<br />require_once('lib\ripcord.php');<br />$url = "http://119593-8-0-eb993b.runbot.odoo.com/";<br />echo "Hello World!0";<br />$db = "119593-8-0-eb993b-all";<br />$username = "admin";<br />$password = "admin";<br />echo "Hello World!1";<br />$models = ripcord::client("$url/xmlrpc/2/object");<br />var_dump($models);<br /><br />echo "Hello World!3";<br />?><br />[/code]<br /><br /><br />[code]<br /><br /><br />Hello World!0.1Hello World!0Hello World!1object(Ripcord_Client)#2 (12) {<br />  ["_url:private"]=><br />  string(57) "http://119593-8-0-eb993b.runbot.odoo.com//xmlrpc/2/object"<br />  ["_transport:private"]=><br />  object(Ripcord_Transport_Stream)#1 (2) {<br />    ["options:private"]=><br />    array(0) {<br />    }<br />    ["responseHeaders"]=><br />    NULL<br />  }<br />  ["_outputOptions:private"]=><br />  array(5) {<br />    ["output_type"]=><br />    string(3) "xml"<br />    ["verbosity"]=><br />    string(6) "pretty"<br />    ["escaping"]=><br />    array(1) {<br />      [0]=><br />      string(6) "markup"<br />    }<br />    ["version"]=><br />    string(6) "xmlrpc"<br />    ["encoding"]=><br />    string(5) "utf-8"<br />  }<br />  ["_namespace:private"]=><br />  NULL<br />  ["_rootClient:private"]=><br />  RECURSION<br />  ["_cloneObjects:private"]=><br />  bool(false)<br />  ["_multiCall:protected"]=><br />  bool(false)<br />  ["_multiCallArgs:protected"]=><br />  array(0) {<br />  }<br />  ["_response"]=><br />  string(0) ""<br />  ["_request"]=><br />  string(0) ""<br />  ["_throwExceptions"]=><br />  bool(false)<br />  ["_autoDecode"]=><br />  bool(true)<br />}<br />Hello World!3<br />[/code]<br /><br /><br /><br />测试完全没有问题.....<br />[/quote]<br /><br /><br />大概是没有ripcord的库, google上的, 谢谢


登录后回复
 

与 Odoo 中文社区 的连接断开,我们正在尝试重连,请耐心等待