Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Session Expired exception in JSON-RPC?

By
ranjith
on 10/30/14, 10:05 AM 1,386 views

1.My authentication URL executes without error & returns id.

2.But in "/web/dataset/search_read" I get session expired error.

3.My authentication URL code: ( No errors).

try{
        ResponseHandler<String> responseHandler = new BasicResponseHandler();
        HttpPost get2 = new HttpPost(authenticateURL);
        login_entity=new StringEntity("{\"jsonrpc\":\"2.0\",\"method\":\"call\",\"params\":{\"db\":\""+Database+"\",\"login\":\""+Username+"\",\"password\":\""+Password+"\",\"base_location\":\""+Url+"\",\"session_id\":\"da4ae8e310eb4ebb8349692f057ecb42\",\"context\":{}},\"id\":\"r7\"}");
        get2.setHeader("Content-Type", "application/json");
   //     get2.setHeader("Cookie:","session_id=da4ae8e310eb4ebb8349692f057ecb42");
        get2.setEntity(login_entity);
        client = (DefaultHttpClient) WebClientDevWrapper.getNewHttpClient();
        responseBody = client.execute(get2, responseHandler);

}

4.Search-read code:(error area)

    try{
                    ResponseHandler<String> responseHandler = new BasicResponseHandler();
                
                   HttpPost get3 = new HttpPost(DBAdapter.getUrlName()+"/web/dataset/search_read");
                   Log.d("2 eng id"+DBAdapter.getDatabaseName(),"2 ses"+DBAdapter.getSessionId());

                   entity = new StringEntity("{\"jsonrpc\":\"2.0\",\"method\":\"call\",\"params\":{\"model\":\"job.order\",\"fields\":[\"job_code\",\"sale_order_id\",\"partner_id\",\"ins_postcode\",\"client_order_ref\",\"cust_po_ref_blanket\",\"engineer_id\",\"appointment\",\"state\"],\"domain\":[[\"state\",\"=\",[\"draft\",\"confirmed\",\"installed\",\"onhold\",\"reject\",\"accepted\"]]],\"context\":{\"lang\":\"en_US\",\"tz\":false,\"uid\":1,\"search_default_open_job\":1,\"bin_size\":true},\"offset\":0,\"limit\":80,\"sort\":\"\",\"session_id\":\"da4ae8e310eb4ebb8349692f057ecb42\"},\"id\":\"r37\"}");
                   get3.setHeader("Content-Type", "application/json");
                   //get3.setHeader("Cookie:","session_id=da4ae8e310eb4ebb8349692f057ecb42");
                   get3.setEntity(entity);
                   client = (DefaultHttpClient) WebClientDevWrapper.getNewHttpClient();
                      
                   responseBody3 = client.execute(get3, responseHandler);
             }

I add cookie header also. But same result.

any help welcome. Thanks for your time.

 

No one answer for my question??

ranjith
on 11/1/14, 7:04 AM
0
zahid
On 5/6/15, 8:26 AM

I have the same probleme and havente figured out any solution .

Any help ?

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 10/30/14, 10:05 AM
Seen: 1386 times
Last updated: 5/6/15, 8:26 AM