mercredi 30 mars 2016

Oracle Error: ORA-29273: HTTP request failed ORA-29259: end-of-input reached

I am trying to call Eloqua API using apex_web_service.make_rest_request() from PL/SQL (using SQL Developer)

 v_clob_body := apex_web_service.make_rest_request(
    p_url              => 'http://ift.tt/1Smrgkp',
    p_http_method      => 'GET',
    p_username         => null,
    p_password         => null,
    p_proxy_override   => '<proxy>',
    p_transfer_timeout => 6000,
    p_body             => null,
    p_body_blob        => empty_blob(),
    p_wallet_path      => '<wallet_path>',
    p_wallet_pwd       => '<wallet_pwd>');

When trying to execute the GET call, it's throwing the following exception:

ORA-29273: HTTP request failed
ORA-29259: end-of-input reached
ORA-06512: at "SYS.UTL_HTTP", line 1258
ORA-06512: at "APEX_050000.WWV_FLOW_WEB_SERVICES", line 615
ORA-06512: at "APEX_050000.WWV_FLOW_WEB_SERVICES", line 657
ORA-06512: at "APEX_050000.WWV_FLOW_WEBSERVICES_API", line 202
ORA-06512: at "MIS_SALES_INTEL_APEX.ELQ_EXTRACT", line 104
ORA-06512: at line 1
29273. 00000 -  "HTTP request failed"
*Cause:    The UTL_HTTP package failed to execute the HTTP request.
*Action:   Use get_detailed_sqlerrm to check the detailed error message.
           Fix the error and retry the HTTP request.

I also do a POST call, before the GET, and it is working perfectly:

apex_web_service.g_request_headers(1).name := 'Content-Type';
apex_web_service.g_request_headers(1).value := 'application/json; charset utf-8';
apex_web_service.g_request_headers(2).name := 'Authorization';
apex_web_service.g_request_headers(2).value := 'Basic <encoded_user_and_pass>';
apex_web_service.g_request_headers(3).name := 'Accept';
apex_web_service.g_request_headers(3).value := 'application/json; charset utf-8';
apex_web_service.g_request_headers(4).name := 'Content-Length';
apex_web_service.g_request_headers(4).value := LENGTH(<length>);

v_clob_body := apex_web_service.make_rest_request(
    p_url              => 'http://ift.tt/1LZWC3I',
    p_http_method      => 'POST',
    p_username         => null,
    p_password         => null,
    p_proxy_override   => '<proxy>',
    p_transfer_timeout => 900,
    p_body             => <body>,
    p_body_blob        => empty_blob(), 
    p_wallet_path      => '<wallet_path>',
    p_wallet_pwd       => '<wallet_pwd>');

With Fiddler it works perfectly, for both calls. I tried to increase the p_transfer_timeout parameter, but it still doesn't work. Has anybody had the same issue when using apex_web_service.make_rest_request()?

Thank you, Iulia




Aucun commentaire:

Enregistrer un commentaire