Fehler bei rename / move object behoben
This commit is contained in:
@@ -113,6 +113,7 @@ create or replace package body pck_net_storage as
|
||||
------------------------------------------------------------------------------------------------------
|
||||
-- MA Datum Änderung
|
||||
-- SCK 2026-04-08 Funktion erstellt
|
||||
-- SCK 2026-04-16 empty_blob()/empty_clob() als Default entfernt — APEX OCI-Signing braucht null für nicht genutzte Body-Parameter
|
||||
------------------------------------------------------------------------------------------------Kopf*/
|
||||
is
|
||||
l_response clob;
|
||||
@@ -128,14 +129,17 @@ create or replace package body pck_net_storage as
|
||||
l_header_index := l_header_index + 1;
|
||||
end if;
|
||||
|
||||
/*
|
||||
-- Content-Length immer mitsenden (OCI-Signing erfordert es bei PUT/POST,
|
||||
-- 0 bei bodylosem Request ist valide)
|
||||
if i_body_blob is not null and dbms_lob.getlength(i_body_blob) > 0
|
||||
if i_body_clob is not null
|
||||
then
|
||||
l_content_length := dbms_lob.getlength(i_body_blob);
|
||||
elsif i_body_clob is not null and dbms_lob.getlength(i_body_clob) > 0
|
||||
l_content_length := coalesce(dbms_lob.getlength(i_body_clob), 0);
|
||||
apex_debug.info('clob content length: ' || l_content_length);
|
||||
elsif i_body_blob is not null
|
||||
then
|
||||
l_content_length := dbms_lob.getlength(i_body_clob);
|
||||
l_content_length := coalesce(dbms_lob.getlength(i_body_blob), 0);
|
||||
apex_debug.info('blob content length: ' || l_content_length);
|
||||
else
|
||||
l_content_length := 0;
|
||||
end if;
|
||||
@@ -143,17 +147,40 @@ create or replace package body pck_net_storage as
|
||||
apex_web_service.g_request_headers(l_header_index).name := 'Content-Length';
|
||||
apex_web_service.g_request_headers(l_header_index).value := l_content_length;
|
||||
l_header_index := l_header_index + 1;
|
||||
*/
|
||||
|
||||
-- nur für BLOB (z.B. leerer Ordner) Content-Length setzen
|
||||
if i_body_blob is not null
|
||||
then
|
||||
l_content_length := coalesce(dbms_lob.getlength(i_body_blob), 0);
|
||||
apex_web_service.g_request_headers(l_header_index).name := 'Content-Length';
|
||||
apex_web_service.g_request_headers(l_header_index).value := l_content_length;
|
||||
l_header_index := l_header_index + 1;
|
||||
end if;
|
||||
|
||||
apex_debug.info('url: ' || i_url);
|
||||
|
||||
l_response := apex_web_service.make_rest_request(
|
||||
p_url => i_url
|
||||
,p_http_method => i_method
|
||||
,p_body => coalesce(i_body_clob, empty_clob())
|
||||
,p_body_blob => coalesce(i_body_blob, empty_blob())
|
||||
,p_credential_static_id => pck_system.f_get_par_wert_by_programmid('NETSTORE_CRED_ID')
|
||||
,p_wallet_path => pck_system.f_get_par_wert_by_programmid('NETSTORE_WALLET_PATH')
|
||||
);
|
||||
if i_body_clob is not null
|
||||
then
|
||||
apex_debug.info('Clob Request Body used:');
|
||||
apex_debug.info(i_body_clob);
|
||||
l_response := apex_web_service.make_rest_request(
|
||||
p_url => i_url
|
||||
,p_http_method => i_method
|
||||
,p_body => i_body_clob
|
||||
,p_credential_static_id => pck_system.f_get_par_wert_by_programmid('NETSTORE_CRED_ID')
|
||||
,p_wallet_path => pck_system.f_get_par_wert_by_programmid('NETSTORE_WALLET_PATH')
|
||||
);
|
||||
else
|
||||
apex_debug.info('BLOB Request Body used! Length: ' || dbms_lob.getlength(i_body_blob));
|
||||
l_response := apex_web_service.make_rest_request(
|
||||
p_url => i_url
|
||||
,p_http_method => i_method
|
||||
,p_body_blob => i_body_blob
|
||||
,p_credential_static_id => pck_system.f_get_par_wert_by_programmid('NETSTORE_CRED_ID')
|
||||
,p_wallet_path => pck_system.f_get_par_wert_by_programmid('NETSTORE_WALLET_PATH')
|
||||
);
|
||||
end if;
|
||||
|
||||
l_status := apex_web_service.g_status_code;
|
||||
|
||||
@@ -734,13 +761,15 @@ create or replace package body pck_net_storage as
|
||||
into l_body
|
||||
from dual;
|
||||
|
||||
-- TEST
|
||||
--l_response := f_make_request(
|
||||
-- i_method => 'POST'
|
||||
-- ,i_url => f_build_url(i_action => 'renameObject')
|
||||
-- ,i_body_clob => l_body
|
||||
-- ,i_content_type => 'application/json'
|
||||
--);
|
||||
apex_debug.info('Request Body:');
|
||||
apex_debug.info(l_body);
|
||||
|
||||
l_response := f_make_request(
|
||||
i_method => 'POST'
|
||||
,i_url => f_build_url(i_action => 'renameObject')
|
||||
,i_body_clob => l_body
|
||||
,i_content_type => 'application/json'
|
||||
);
|
||||
|
||||
l_obj_path := f_split_object_key(i_object_key);
|
||||
pck_log.p_info(
|
||||
|
||||
Reference in New Issue
Block a user