This question has been flagged
2 Replies
5706 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.

 

Avatar
Discard
Author

No one answer for my question??

Best Answer

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

Any help ?

Avatar
Discard