Skip to Content
Menu
This question has been flagged
2 Replies
12218 Views

Hi,

I'm working on integration between Odoo V8 and Drupal 7 and am having a bit of trouble making a connection to my Saas at https://cool-test1.odoo.com/

I'm using the code examples available at https://www.odoo.com/documentation/8.0/api_integration.html

When I use the URL https://demo.odoo.com/start in the $info = section I get a valid response

<?php

  $url = 'https://cool-test1.odoo.com';
  $db = 'cool-test1';
  $username = "admin";
  $password = '*****';

  require_once('ripcord-1.1/ripcord.php');
  $info = ripcord::client('https://demo.odoo.com/start')->start();
  list($url, $db, $username, $password) = array($info['host'], $info['database'], $info['user'], $info['password']);

  $common = ripcord::client("$url/xmlrpc/common");
  print_r($common->version());

  $uid = $common->authenticate($db, $username, $password, array());

?>

When I change $info = ripcord::client('https://demo.odoo.com/start')->start() to equal my saas server e.g. $info = ripcord::client('https://cool-test1.odoo.com/start')->start(); I get the below error:

Fatal error: Uncaught exception 'Ripcord_TransportException' with message 'Could not access https://cool-test1.odoo.com/start' in /usr/local/nginx/html/xmlrpc/ripcord-1.1/ripcord_client.php:488 Stack trace: #0 /usr/local/nginx/html/xmlrpc/ripcord-1.1/ripcord_client.php(228): Ripcord_Transport_Stream->post('https://cool-te...', '__call('start', Array) #2 /usr/local/nginx/html/xmlrpc/test.php(9): Ripcord_Client->start() #3 {main} thrown in /usr/local/nginx/html/xmlrpc/ripcord-1.1/ripcord_client.php on line 488

I have noticed that when you visit https://demo.odoo.com/start in a browser you get an XMLRPC error about the method, when you visit my Saas https://cool-test1.odoo.com/start you just get a 404.

Is there something I need to enable on my Saas somewhere? I followed the instructions here https://www.odoo.com/forum/help-1/question/is-the-xml-rpc-api-available-on-openerp-online-915 and enabled a password on my admin user which I'm using in my test code.

Any help would be much appreciated.

Thanks,

 

 

 

 

Avatar
Discard
Best Answer

Following code is valid and working fine tested on multiple servers. but one of my live server gives me error of  Could not access ###.###.###.##:8069  

$url = 'https://###.###.###.##:8069'; 
$db = 'demo';
$username = 'user_name';
$password = 'password';
$common = ripcord::client("$url/xmlrpc/2/common");
$models = ripcord::client("$url/xmlrpc/2/object");
$common->version();
$uid = $common->authenticate($db, $username, $password, array());

Check your server settings as I found the solution from someone else.

  1. Domain seemed to have a poblem with the default RipcurlTransport (Stream); perhaps a problem with file system permissions. Switching to Curl solved the problem of not being able to connect to the Odoo demo database.
  2. The server is behind a Firewall, which needed to allow outgoing connections to port 8069. This solved the problem of not being able to connect to the production database.

It may help.

Avatar
Discard
Best Answer

replace your URL to this https://www.odoo.com/start/xmlrpc

use your odoo account & password (when your register to odoo.com) to login.

for local URL will be like this http://localhost:8069 (without /start/xmlrpc).

you can try to use Java with this solution from this question

https://www.odoo.com/forum/help-1/question/how-to-access-odoo-8-using-java-xmlrpc-83836

Avatar
Discard
Related Posts Replies Views Activity
1
Oct 24
274
1
Apr 24
518
2
Mar 24
752
0
Sep 23
577
1
Jun 23
819