Se rendre au contenu
Odoo Menu
  • Se connecter
  • Essai gratuit
  • Applications
    Finance
    • Comptabilité
    • Facturation
    • Notes de frais
    • Feuilles de calcul (BI)
    • Documents
    • Signature
    Ventes
    • CRM
    • Ventes
    • PdV Boutique
    • PdV Restaurant
    • Abonnements
    • Location
    Sites web
    • Site Web
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Chaîne d'approvisionnement
    • Inventaire
    • Fabrication
    • PLM
    • Achats
    • Maintenance
    • Qualité
    Ressources Humaines
    • Employés
    • Recrutement
    • Congés
    • Évaluations
    • Recommandations
    • Parc automobile
    Marketing
    • Marketing Social
    • E-mail Marketing
    • SMS Marketing
    • Événements
    • Marketing Automation
    • Sondages
    Services
    • Projet
    • Feuilles de temps
    • Services sur Site
    • Assistance
    • Planification
    • Rendez-vous
    Productivité
    • Discussion
    • Validations
    • Internet des Objets
    • VoIP
    • Connaissances
    • WhatsApp
    Applications tierces Odoo Studio Plateforme Cloud d'Odoo
  • Industries
    Commerce de détail
    • Librairie
    • Magasin de vêtements
    • Magasin de meubles
    • Épicerie
    • Quincaillerie
    • Magasin de jouets
    Food & Hospitality
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Maison d’hôtes
    • Distributeur de boissons
    • Hôtel
    Immobilier
    • Agence immobilière
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consultance
    • Cabinet d'expertise comptable
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Métal
    • Meubles
    • Alimentation
    • Brewery
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Trades
    • Bricoleur
    • Matériel informatique et support
    • Systèmes photovoltaïques
    • Cordonnier
    • Services de nettoyage
    • Services CVC
    Autres
    • Organisation à but non lucratif
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Browse all Industries
  • Communauté
    Apprenez
    • Tutoriels
    • Documentation
    • Certifications
    • Formation
    • Blog
    • Podcast
    Renforcer l'éducation
    • Programme éducatif
    • Business Game Scale-Up!
    • Rendez-nous visite
    Obtenir le logiciel
    • Téléchargement
    • Comparez les éditions
    • Versions
    Collaborer
    • Github
    • Forum
    • Événements
    • Traductions
    • Devenez partenaire
    • Services for Partners
    • Enregistrer votre cabinet comptable
    Nos Services
    • Trouver un partenaire
    • Trouver un comptable
    • Rencontrer un conseiller
    • Services de mise en œuvre
    • Références clients
    • Assistance
    • Mises à niveau
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obtenir une démonstration
  • Tarification
  • Aide

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

  • CRM
  • e-Commerce
  • Comptabilité
  • Inventaire
  • PoS
  • Projet
  • MRP
All apps
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Aide

How to access ODOO 8 using Java xmlrpc?

S'inscrire

Recevez une notification lorsqu'il y a de l'activité sur ce poste

Cette question a été signalée
xmlrpcjava
2 Réponses
16787 Vues
Avatar
IGAM Muliarsa

i follow this documentation https://www.odoo.com/documentation/8.0/api_integration.html to connect java to odoo 8 web services.

I tried both online and localhost, but none are working.

  1. http://localhost:8069/start nor https://demo.odoo.com/start

  2. http://localhost:8069/xmlrpc nor https://demo.odoo.com/xmlrp 

  3. http://localhost:8069/xmlrpc/2/common nor https://demo.odoo.com/xmlrpc/2/common

the error said no url found/exist.

org.apache.xmlrpc.client.XmlRpcHttpTransportException: HTTP server returned unexpected status: NOT FOUND 

Sincerely

IGAM Muliarsa

Here is my source code:

import java.net.MalformedURLException;
import java.net.URL;
import org.apache.xmlrpc.XmlRpcException;
import org.apache.xmlrpc.client.XmlRpcClient;
import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;
public class TestOdoo {
      public static void main(String[] args) {
           //String url = "http://localhost:8069/xmlrpc/common";
           String url = "https://demo.odoo.com";
           //String url = "https://demo.odoo.com/start";
           XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
           try {
                 config.setServerURL(new URL(url+"/xmlrpc/2/common"));
           } catch (MalformedURLException e) {
                e.printStackTrace();
           }
           XmlRpcClient client = new XmlRpcClient();
          client.setConfig(config);
          Object[] params = new Object[]{"test", "admin", "admin"}; Object res;
          try {
              res = client.execute("login", params);
              System.out.print(res);
          } catch (XmlRpcException e) {
              e.printStackTrace();
          }
      } }

0
Avatar
Ignorer
Jérémy Kersten (jke)

Yeah, not much happens here ;)

Avatar
IGAM Muliarsa
Auteur Meilleure réponse

Nobody is active on in these forum...... btw I found the solution. here is the source to whom concern or need the source code. don't forget to import library required to test this source... documentation on https://www.odoo.com/documentation/8.0/api_integration.html will not work at all.

 public static void main(String[] args) throws MalformedURLException, XmlRpcException {
      String url = "http://192.168.0.100:8069"; // work with odoo.com account!!
      String db = "test";
      String username = "admin";
      String password = "admin";
      System.out.println("Get database list");
      System.out.println("Login");
      System.out.println("--------------");
      int uid = login(url,db,username,password);
      if (uid >0) {
          System.out.println("Login Ok");
      } else {
           System.out.println("Login Fail");
      }
}
// login
static int login(String url, String db, String login, String password) throws XmlRpcException, MalformedURLException {
      XmlRpcClient client = new XmlRpcClient();
      XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
      config.setEnabledForExtensions(true);
      //config.setServerURL(new URL(url+"/xmlrpc/common"));
      config.setServerURL(new URL(url+"/xmlrpc/2/common"));
      client.setConfig(config);
      //Connect
      //Object[] empty = null; // Ok
      //Object[] params = new Object[] {db,login,password, empty}; // Ok
      Object[] params = new Object[] {db,login,password}; // Ok & simple
      Object uid = client.execute("login", params);
      if (uid instanceof Integer)
          return (int) uid;
      return -1;
}

1
Avatar
Ignorer
Ashish Singh

What jar file u had used for this, can u share a link also

xiaolong97427

Thx IGAM Muliarsa for sharing

Thank you IGAM Muliarsa very much! Finally I have a working Kotlin code to access OpenERP.

IGAM Muliarsa
Auteur

you're welcome. nice to hear the code work :)

Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !

Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !

S'inscrire
Publications associées Réponses Vues Activité
How do I put XMLRPC parameters to list record Résolu
xmlrpc java
Avatar
Avatar
2
août 17
15037
Email Invoices and Quotations using Java and XMLRPC
xmlrpc java odoo
Avatar
Avatar
1
juil. 25
2314
Retrieve many2one field value using xmlrpc java
many2one xmlrpc java
Avatar
Avatar
2
mars 15
11749
xmlrpc Error when attempting to connect to my local instance Résolu
xmlrpc
Avatar
Avatar
Avatar
3
juil. 25
4216
Cannot marshal None unless allow_none is enabled
xmlrpc
Avatar
1
oct. 24
3084
Communauté
  • Tutoriels
  • Documentation
  • Forum
Open Source
  • Téléchargement
  • Github
  • Runbot
  • Traductions
Services
  • Hébergement Odoo.sh
  • Assistance
  • Migration
  • Développements personnalisés
  • Éducation
  • Trouver un comptable
  • Trouver un partenaire
  • Devenez partenaire
À propos
  • Notre société
  • Actifs de la marque
  • Contactez-nous
  • Emplois
  • Événements
  • Podcast
  • Blog
  • Clients
  • Informations légales • Confidentialité
  • Sécurité.
الْعَرَبيّة 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 est une suite d'applications open source couvrant tous les besoins de votre entreprise : CRM, eCommerce, Comptabilité, Inventaire, Point de Vente, Gestion de Projet, etc.

Le positionnement unique d'Odoo est d'être à la fois très facile à utiliser et totalement intégré.

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