Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

How to access ODOO 8 using Java xmlrpc?

Odoberať

Get notified when there's activity on this post

This question has been flagged
xmlrpcjava
2 Replies
16777 Zobrazenia
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
Zrušiť
Jérémy Kersten (jke)

Yeah, not much happens here ;)

Avatar
IGAM Muliarsa
Autor Best Answer

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
Zrušiť
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
Autor

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

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

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

Registrácia
Related Posts Replies Zobrazenia Aktivita
How do I put XMLRPC parameters to list record Solved
xmlrpc java
Avatar
Avatar
2
aug 17
15031
Email Invoices and Quotations using Java and XMLRPC
xmlrpc java odoo
Avatar
Avatar
1
júl 25
2311
Retrieve many2one field value using xmlrpc java
many2one xmlrpc java
Avatar
Avatar
2
mar 15
11737
xmlrpc Error when attempting to connect to my local instance Solved
xmlrpc
Avatar
Avatar
Avatar
3
júl 25
4212
Cannot marshal None unless allow_none is enabled
xmlrpc
Avatar
1
okt 24
3075
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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