Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8121239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T05:25:26+00:00 2026-06-06T05:25:26+00:00

I am trying to insert customer details into OpenERP server using XMLPRC and java.

  • 0

I am trying to insert customer details into OpenERP server using XMLPRC and java. I am able to do an authentication. But when i call the execute method to insert the record by passing the parameters, am getting Exception in thread “main” java.lang.NullPointerException on line res_create = client_1.execute(“execute”, params_create);

Please find my code below


    res = client.execute("login", params);

        String url_1 = "http://agilewebdevelopment.net:8514/xmlrpc/object";
        XmlRpcClientConfigImpl config_1 = new XmlRpcClientConfigImpl();
        try {
            config_1.setServerURL(new URL(url_1));
        } catch (MalformedURLException e) {
            System.out.println("First");
            e.printStackTrace();
        }
        System.out.println(res);
        HashMap<String, Object> vals = new HashMap<String, Object>();
        vals.put("name", "Mantavya Gajjar");
        vals.put("ref", "MGA");
        XmlRpcClient client_1 = new XmlRpcClient();
        client.setConfig(config_1);
        Object[] params_create = new Object[]{"erp_performance", "1", "admin", "res.partner", "create", vals};

        Object res_create = null;
        try {
             res_create = client_1.execute("execute", params_create);
        } catch (XmlRpcException e) {
            e.printStackTrace();
        }

Any helps is appreciated

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T05:25:27+00:00Added an answer on June 6, 2026 at 5:25 am

    If you are able to authentication that means you have working XMLRPC connection, now in case of authentication the OpenERP Services you will be using is common service so you will have client object which will be proxy to http://host:posrt/xmlrpc/common that is perfectly right.

    But if you want to do any operation on any of the OE Model then for that OE Provides Separate services that is OBJECT service so in that case your client object must be proxy to http://host:port/xmlrpc/object and then you can call execute method on it, you can see we do not have execute method implemented for the common service on link http://bazaar.launchpad.net/~openerp/openobject-server/trunk/view/head:/openerp/service/web_services.py#L379

    For more you can see OE and JAVA

    I have Prepared Some scartch code you try in case

    package com.xmlrpc.client;
    
    import java.net.URL;
    import java.util.HashMap;
    import java.util.Vector;
    
    import org.apache.xmlrpc.client.XmlRpcClient;
    import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;
    
    public class Create {
    
    public static void main(String args[]) throws Exception {
    
    Vector params1 = new Vector();
    params1.addElement("openerpdb");
    params1.addElement("admin");
    params1.addElement("admin");
    
    XmlRpcClient xmlrpcLogin = new XmlRpcClient();
    XmlRpcClientConfigImpl xmlrpcConfigLogin = new XmlRpcClientConfigImpl();
    xmlrpcConfigLogin.setEnabledForExtensions(true);
    xmlrpcConfigLogin.setServerURL(new URL("http", "localhost", 8069, "/xmlrpc/common"));
    xmlrpcLogin.setConfig(xmlrpcConfigLogin);
    
    Object id = xmlrpcLogin.execute("login", params1);
    System.out.println("Login Id : " + id.toString());
    
    System.out.println("------------------------");
    
    XmlRpcClient client = new XmlRpcClient();
    XmlRpcClientConfigImpl clientConfig = new XmlRpcClientConfigImpl();
    clientConfig.setEnabledForExtensions(true);
    clientConfig.setServerURL(new URL("http", "localhost", 8069, "/xmlrpc/object"));
    client.setConfig(clientConfig);
    
    HashMap<Object, Object> params = new HashMap<Object, Object>();
    
    params.put("street", "Edamon3");
    params.put("partner_id", "24");
    params.put("city", "Punalur3");
    params.put("name", "ShameerHabeeb3");
    
    Vector<Object> arg = new Vector<Object>();
    
    arg.add("openerpdb");
    arg.add(1);
    arg.add("admin");
    arg.add("res.partner.address");
    arg.add("create");
    arg.add(params);
    
    Object ret_id = client.execute("execute", arg);
    System.out.println("Created new partner address with id :" + ret_id.toString());
    
    }
    

    }

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently trying to insert an object into the Customer table using a test SQL
I'm trying to INSERT into a table, but I get the error Cannot add
I'm trying to insert data into a database that I have on my server.
I am trying to insert some text into <textarea> by query but it is
I am trying to insert values into selected columns of table, but only insert
I'm trying insert on a view using datanucleus, the problem is, when i put
Trying to insert 315K Gif files into an Oracle 10g database. Everytime I get
im trying to insert this query with mysql_query INSERT INTO um_group_rights (`um_group_id`,`cms_usecase_id`,`um_right_id`) VALUES (2,1,1)
Am trying to insert XML into XML Column.. getting following error: . Msg 6819,
I am trying to insert data in MySQL using Python. There is an error

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.