我试图使用PL / SQL中的Eloqua API来调用apex_web_service.make_rest_request()(使用SQL Developer)
v_clob_body := apex_web_service.make_rest_request(
p_url => 'https://secure.p02.eloqua.com/API/Bulk/2.0/contacts/exports/1/data?offset=0',
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>');
尝试执行GET调用时,会抛出以下异常:
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 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.
我也在GET之前做了一个POST调用,它运行得很好:
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 => 'https://secure.p02.eloqua.com/API/Bulk/2.0/customObjects/1/exports',
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>');
对于Fiddler来说,两种电话都能很好地工作。
我试图增加p_transfer_timeout
参数,但它仍然不起作用。
使用apex_web_service.make_rest_request()
时有没有人遇到同样的问题?
谢谢你, 尤利亚