跳转至内容
  • 版块
  • 标签
  • 热门
  • 用户
  • 群组
皮肤
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • 默认(Flatly)
  • 不使用皮肤
折叠

Odoo 中文社区

  1. 主页
  2. 版块
  3. Odoo 开发与实施交流
  4. 求助: odoo8 xmlrpc接口中php编程需要调用ripcord库,调用失败

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

已定时 已固定 已锁定 已移动 Odoo 开发与实施交流
4 帖子 2 发布者 2.2k 浏览
  • 从旧到新
  • 从新到旧
  • 最多赞同
登录后回复
此主题已被删除。只有拥有主题管理权限的用户可以查看。
  • N 离线
    N 离线
    newnewman80
    写于 最后由 编辑
    #1

    环境: ubuntu12.04  odoo8 php5
    官方说明是:
    Note

    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.

    Since calls are performed over HTTPS, it also requires that the OpenSSL extension be enabled

    于是:
    sudo apt-get install php5-xmlrpc
    sudo apt-get install openssl
    sudo apt-get install libssl-dev
    sudo apt-get install libssl0.9.8
    sudo apt-get install libgtk2.0-dev


    <!DOCTYPE html>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <html>
    <body>

    <h1>odoo php api test</h1>

    <?php
    echo "Hello World!0.1";
    require_once('ripcord.php');
    $url = "http://10.0.10.219:8069";
    echo "Hello World!0";
    $db = "flaginfo";
    $username = "admin";
    $password = "111111";
    echo "Hello World!1";
    $models = ripcord::client("$url/xmlrpc/2/object");

    echo "Hello World!3";
    ?>

    </body>
    </html>


    运行结果:
    odoo php api test
    Hello World!0.1

    调用失败。 这个如何定位问题?

    1 条回复 最后回复
    0
    • mrshellyM 离线
      mrshellyM 离线
      mrshelly
      写于 最后由 编辑
      #2

      [attachurl=1]


      <br />&lt;?php<br />//exit(phpinfo());<br /><br />echo &quot;Hello World!0.1&quot;;<br />require_once(&#039;lib\ripcord.php&#039;);<br />$url = &quot;http://119593-8-0-eb993b.runbot.odoo.com/&quot;;<br />echo &quot;Hello World!0&quot;;<br />$db = &quot;119593-8-0-eb993b-all&quot;;<br />$username = &quot;admin&quot;;<br />$password = &quot;admin&quot;;<br />echo &quot;Hello World!1&quot;;<br />$models = ripcord::client(&quot;$url/xmlrpc/2/object&quot;);<br />var_dump($models);<br /><br />echo &quot;Hello World!3&quot;;<br />?&gt;<br />
      




      <br /><br /><br />Hello World!0.1Hello World!0Hello World!1object(Ripcord_Client)#2 (12) {<br />&nbsp; [&quot;_url:private&quot;]=&gt;<br />&nbsp; string(57) &quot;http://119593-8-0-eb993b.runbot.odoo.com//xmlrpc/2/object&quot;<br />&nbsp; [&quot;_transport:private&quot;]=&gt;<br />&nbsp; object(Ripcord_Transport_Stream)#1 (2) {<br />&nbsp; &nbsp; [&quot;options:private&quot;]=&gt;<br />&nbsp; &nbsp; array(0) {<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; [&quot;responseHeaders&quot;]=&gt;<br />&nbsp; &nbsp; NULL<br />&nbsp; }<br />&nbsp; [&quot;_outputOptions:private&quot;]=&gt;<br />&nbsp; array(5) {<br />&nbsp; &nbsp; [&quot;output_type&quot;]=&gt;<br />&nbsp; &nbsp; string(3) &quot;xml&quot;<br />&nbsp; &nbsp; [&quot;verbosity&quot;]=&gt;<br />&nbsp; &nbsp; string(6) &quot;pretty&quot;<br />&nbsp; &nbsp; [&quot;escaping&quot;]=&gt;<br />&nbsp; &nbsp; array(1) {<br />&nbsp; &nbsp; &nbsp; [0]=&gt;<br />&nbsp; &nbsp; &nbsp; string(6) &quot;markup&quot;<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; [&quot;version&quot;]=&gt;<br />&nbsp; &nbsp; string(6) &quot;xmlrpc&quot;<br />&nbsp; &nbsp; [&quot;encoding&quot;]=&gt;<br />&nbsp; &nbsp; string(5) &quot;utf-8&quot;<br />&nbsp; }<br />&nbsp; [&quot;_namespace:private&quot;]=&gt;<br />&nbsp; NULL<br />&nbsp; [&quot;_rootClient:private&quot;]=&gt;<br />&nbsp; *RECURSION*<br />&nbsp; [&quot;_cloneObjects:private&quot;]=&gt;<br />&nbsp; bool(false)<br />&nbsp; [&quot;_multiCall:protected&quot;]=&gt;<br />&nbsp; bool(false)<br />&nbsp; [&quot;_multiCallArgs:protected&quot;]=&gt;<br />&nbsp; array(0) {<br />&nbsp; }<br />&nbsp; [&quot;_response&quot;]=&gt;<br />&nbsp; string(0) &quot;&quot;<br />&nbsp; [&quot;_request&quot;]=&gt;<br />&nbsp; string(0) &quot;&quot;<br />&nbsp; [&quot;_throwExceptions&quot;]=&gt;<br />&nbsp; bool(false)<br />&nbsp; [&quot;_autoDecode&quot;]=&gt;<br />&nbsp; bool(true)<br />}<br />Hello World!3<br />
      





      测试完全没有问题.....

      1 条回复 最后回复
      0
      • N 离线
        N 离线
        newnewman80
        写于 最后由 编辑
        #3

        [quote author=mrshelly link=topic=17439.msg31611#msg31611 date=1450161290]
        [attachurl=1]


        <br />&lt;?php<br />//exit(phpinfo());<br /><br />echo &quot;Hello World!0.1&quot;;<br />require_once(&#039;lib\ripcord.php&#039;);<br />$url = &quot;http://119593-8-0-eb993b.runbot.odoo.com/&quot;;<br />echo &quot;Hello World!0&quot;;<br />$db = &quot;119593-8-0-eb993b-all&quot;;<br />$username = &quot;admin&quot;;<br />$password = &quot;admin&quot;;<br />echo &quot;Hello World!1&quot;;<br />$models = ripcord::client(&quot;$url/xmlrpc/2/object&quot;);<br />var_dump($models);<br /><br />echo &quot;Hello World!3&quot;;<br />?&gt;<br />
        




        <br /><br /><br />Hello World!0.1Hello World!0Hello World!1object(Ripcord_Client)#2 (12) {<br />&nbsp; [&quot;_url:private&quot;]=&gt;<br />&nbsp; string(57) &quot;http://119593-8-0-eb993b.runbot.odoo.com//xmlrpc/2/object&quot;<br />&nbsp; [&quot;_transport:private&quot;]=&gt;<br />&nbsp; object(Ripcord_Transport_Stream)#1 (2) {<br />&nbsp; &nbsp; [&quot;options:private&quot;]=&gt;<br />&nbsp; &nbsp; array(0) {<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; [&quot;responseHeaders&quot;]=&gt;<br />&nbsp; &nbsp; NULL<br />&nbsp; }<br />&nbsp; [&quot;_outputOptions:private&quot;]=&gt;<br />&nbsp; array(5) {<br />&nbsp; &nbsp; [&quot;output_type&quot;]=&gt;<br />&nbsp; &nbsp; string(3) &quot;xml&quot;<br />&nbsp; &nbsp; [&quot;verbosity&quot;]=&gt;<br />&nbsp; &nbsp; string(6) &quot;pretty&quot;<br />&nbsp; &nbsp; [&quot;escaping&quot;]=&gt;<br />&nbsp; &nbsp; array(1) {<br />&nbsp; &nbsp; &nbsp; [0]=&gt;<br />&nbsp; &nbsp; &nbsp; string(6) &quot;markup&quot;<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; [&quot;version&quot;]=&gt;<br />&nbsp; &nbsp; string(6) &quot;xmlrpc&quot;<br />&nbsp; &nbsp; [&quot;encoding&quot;]=&gt;<br />&nbsp; &nbsp; string(5) &quot;utf-8&quot;<br />&nbsp; }<br />&nbsp; [&quot;_namespace:private&quot;]=&gt;<br />&nbsp; NULL<br />&nbsp; [&quot;_rootClient:private&quot;]=&gt;<br />&nbsp; *RECURSION*<br />&nbsp; [&quot;_cloneObjects:private&quot;]=&gt;<br />&nbsp; bool(false)<br />&nbsp; [&quot;_multiCall:protected&quot;]=&gt;<br />&nbsp; bool(false)<br />&nbsp; [&quot;_multiCallArgs:protected&quot;]=&gt;<br />&nbsp; array(0) {<br />&nbsp; }<br />&nbsp; [&quot;_response&quot;]=&gt;<br />&nbsp; string(0) &quot;&quot;<br />&nbsp; [&quot;_request&quot;]=&gt;<br />&nbsp; string(0) &quot;&quot;<br />&nbsp; [&quot;_throwExceptions&quot;]=&gt;<br />&nbsp; bool(false)<br />&nbsp; [&quot;_autoDecode&quot;]=&gt;<br />&nbsp; bool(true)<br />}<br />Hello World!3<br />
        





        测试完全没有问题.....
        [/quote]


        大概是没有ripcord的库, google上的, 谢谢

        1 条回复 最后回复
        0

        • 登录

        • 没有帐号? 注册

        • 登录或注册以进行搜索。
        • 第一个帖子
          最后一个帖子
        0
        • 版块
        • 标签
        • 热门
        • 用户
        • 群组