Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

Can't access to External API using PHP XML-RPC - Access Denied, Ripcord_TransportException

Subscriure's

Get notified when there's activity on this post

This question has been flagged
phpodooXML-RPC
1 Respondre
12468 Vistes
Avatar
stephane-lgb

Hi all :)


I'm working on Odoo External API for my website using PHP 7.


The XML RPC and OpenSSL extensions are enabled on my server, and the website is even secured (there's the lock icon in the address bar).


For now, we want to test it with Odoo Demo Trial. So in my php code, I have put the same username/password as the one I use to connect to my odoo demo account.


1°) But I'm getting faultCode and faultString (Access Denied)


$url = 'https://lgb-test.odoo.com';  // Odoo Demo Trial
$db = 'lgb-test';
$username = 'johndoe@mywebsiteexample.com'; /* Same Email as the one to connect to https://lgb-test.odoo.com/web/login */
$password = 'mypasswordexample'; /* Same Password as the one to connect to https://lgb-test.odoo.com/web/login */ require_once('ripcord/ripcord.php'); $common = ripcord::client($url.'/xmlrpc/2/common'); $uid = $common->authenticate($db, $username, $password, array()); echo('UID:'); var_dump($uid); echo('<br/>'); $models = ripcord::client("$url/xmlrpc/2/object"); $partners = $models->execute_kw( $db, $uid, $password, 'res.partner', 'search', array( array( array('is_company', '=', true) ) ) ); echo('RESULT:<br/>'); foreach ($partners as $partner) { echo 'partner=['.$partner.']<br/>'; } echo('VAR_DUMP:<br/>'); var_dump($partners);


Output :

UID:bool(false)
RESULT:
partner=[3]
partner=[Access Denied]
VAR_DUMP:
array(2) { ["faultCode"]=> int(3) ["faultString"]=> string(13) "Access Denied" }


2°) When the start( ) method is called, I get Fatal error: Uncaught Ripcord_TransportException: Could not access


require_once('ripcord/ripcord.php');        
$info = ripcord::client('https://lgb-test.odoo.com/start/')->start();

echo 'hello';


Output :

Fatal error: Uncaught Ripcord_TransportException: Could not access https://lgb-test.odoo.com/start/ in /var/www/vhosts/mywebsiteexample.com/preprod.mywebsiteexample.com/ripcord/ripcord_client.php:488 Stack trace: #0 /var/www/vhosts/mywebsiteexample.com/preprod.mywebsiteexample.com/ripcord/ripcord_client.php(228): Ripcord_Transport_Stream->post('https://lgb-tes...', '<?xml version="...') #1 /var/www/vhosts/mywebsiteexample.com/preprod.mywebsiteexample.com/index.php(10): Ripcord_Client->__call('start', Array) #2 {main} thrown in /var/www/vhosts/mywebsiteexample.com/preprod.mywebsiteexample.com/ripcord/ripcord_client.php on line 488


This problem doesn't seem to be an isolated case for years, but I didn't find the right answer yet.

Could anyone help please ?

0
Avatar
Descartar
Avatar
stephane-lgb
Autor Best Answer

1°) As nobody replied here in the forum, and after few weeks looking for a solution, we decided to purchase some modules, instead of using the Odoo Demo account.


Then, I just changed the credentials for my new database, and also opened the 8069 port for that specific Address. And it worked :)



Code :


$url = 'https://thedatabasename.odoo.com';   // Edited here. And opening the firewall's 8069 port was the last step to make it work :)
$db = 'thedatabasename'; // Edited here $username = 'usernameofthataccount'; // Edited here $password = 'passwordofthataccount'; // Edited here require_once('ripcord/ripcord.php'); $common = ripcord::client($url.'/xmlrpc/2/common'); $uid = $common->authenticate($db, $username, $password, array()); echo('UID:'); var_dump($uid); echo('<br/>'); $models = ripcord::client("$url/xmlrpc/2/object"); $partners = $models->execute_kw( $db, $uid, $password, 'res.partner', 'search', array( array( array('is_company', '=', true) ) ) ); echo('RESULT:<br/>'); foreach ($partners as $partner) { echo 'partner=['.$partner.']<br/>'; } echo('VAR_DUMP:<br/>'); var_dump($partners);


Output :

UID:int(2)
RESULT:
partner=[568]
partner=[570]
partner=[293]
partner=[378]
partner=[526]
VAR_DUMP:
array(193) { [0]=> int(568) [1]=> int(570) [2]=> int(293) [3]=> int(378) [4]=> int(526)}


2°) The start( ) method didn't work with the specific Address though


So, I'm not sure that the start( ) method will work with something else than a Demo account.

Also, Odoo's Support told me to not include the "/start" part of the URL in the script. But, with or without the "/start" part, it didn't work.



Code :

require_once('ripcord/ripcord.php');
$info = ripcord::client('https://thedatabasename.odoo.com/start')->start();  // Even after using the specific Address (not the demo) and opened the 8069 port, this hasn't worked in my case
echo 'hello';


Output :

Fatal error: Uncaught Ripcord_TransportException: Could not access http://102.16.10.74:8069/start/ in /var/www/vhosts/mywebsiteexample.com/preprod.mywebsiteexample.com/ripcord/ripcord_client.php:488 Stack trace: #0 /var/www/vhosts/mywebsiteexample.com/preprod.mywebsiteexample.com/ripcord/ripcord_client.php(228): Ripcord_Transport_Stream->post('http://102.16.1...', '<?xml version="...') #1 /var/www/vhosts/mywebsiteexample.com/preprod.mywebsiteexample.com/index.php(11): Ripcord_Client->__call('start', Array) #2 {main} thrown in /var/www/vhosts/mywebsiteexample.com/preprod.mywebsiteexample.com/ripcord/ripcord_client.php on line 488


My Conclusion is :

Odoo DEMO has NOT worked for me, even if I followed the instructions from here :

https://www.odoo.com/documentation/14.0/webservices/odoo.html

0
Avatar
Descartar
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrar-se
Related Posts Respostes Vistes Activitat
Stock inventory with API in PHP
api php odoo
Avatar
0
de gen. 23
6639
XML-RPC Connection Problem in Live Server of PHP Site Solved
php odoo8.0 XML-RPC
Avatar
1
de febr. 19
8415
Trying to get data from Odoo using PHP/Laravel-9 using XMLRPC need help and guidance
xmlrpc odoo XML-RPC PHP
Avatar
Avatar
1
de jul. 25
3124
Connecting Odoo 12 error via xmlrpc library
xmlrpc odoo XML-RPC odoo12
Avatar
Avatar
1
de set. 19
10157
Connect to Odoo V6.0 using XMLRPC
v6.0 php xmlrpc odoo
Avatar
0
de des. 17
3825
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now