web services - Timeout error handling using utl_http in oracle -


one please ie

when use utl_http.set_transfer_timeout (180);

how handle situation after timeout , example ws did not respond more 180 sec. should handle that. in requirement.

we should timeout error; , insert sepearte logging table error message.

can please me on this

 utl_http.set_wallet (l_chr_wallet_path, l_chr_wallet_pwd);    -- initializing request.   utl_http.set_transfer_timeout (l_chr_timeout);    l_request :=      utl_http.begin_request (url            => l_chr_ws_url,                              method         => l_chr_method,                              http_version   => l_chr_http_version);    -- setting authentications.   utl_http.set_authentication (l_request,                                user_id,                                password);    -- setting appropriate headers.   utl_http.set_header (l_request, l_chr_usr_agnt, l_chr_usr_agnt_val);   utl_http.set_header (l_request, l_chr_conn, l_chr_conn_value);   utl_http.set_header (l_request,                        l_chr_content_type,                        l_chr_cnt_type_value);   utl_http.set_header (l_request,                        l_chr_content_lgth,                        dbms_lob.getlength (l_chr_req_txt));   utl_http.set_header (l_request, l_chr_trnsf_enc, l_chr_trnsf_enc_val);          l_num_req_bdy_lgth := dbms_lob.getlength (l_chr_req_txt);   l_num_chnk_offst := 1;    while (l_num_chnk_offst < l_num_req_bdy_lgth)   loop      if l_num_chnk_offst + l_num_bfr_size >= l_num_req_bdy_lgth              l_num_chnk_lgth := l_num_req_bdy_lgth - l_num_chnk_offst + 1;      else         l_num_chnk_lgth := l_num_bfr_size;      end if;       dbms_lob.read (l_chr_req_txt,                     l_num_chnk_lgth,                     l_num_chnk_offst,                     l_chr_buffer);      dbms_output.put_line (         'before ws write : ' || 'l_chr_buffer : ' || l_chr_buffer);      dbms_output.put_line (         'before ws write : ' || 'l_num_chnk_offst : ' || l_num_chnk_offst);      dbms_output.put_line (         'before ws write : ' || 'l_num_chnk_lgth : ' || l_num_chnk_lgth);       utl_http.write_text (l_request, l_chr_buffer); -- data => l_chr_req_txt);      l_num_chnk_offst := l_num_chnk_offst + l_num_chnk_lgth;   end loop;    l_response := utl_http.get_response (l_request);          -- print response.   loop      --utl_http.read_line (l_response, l_chr_buffer, true);       utl_http.read_text (l_response, l_chr_buffer, 32000);      l_resp_clob := l_resp_clob || l_chr_buffer;   end loop;    utl_http.end_response (l_response);   dbms_lob.close (l_resp_clob);   dbms_lob.freetemporary (l_resp_clob);   p_o_status := 's'; 


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -