Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
6940 Lượt xem

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.

 

Ảnh đại diện
Huỷ bỏ
Tác giả

No one answer for my question??

Câu trả lời hay nhất

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

Any help ?

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 1 21
12909
2
thg 12 19
9279
1
thg 4 17
12415
0
thg 3 15
5261
4
thg 3 25
41863