Hi everyone,
I’m trying to make a REST call to the Autenticacao.gov service from APEX using apex_web_service.make_rest_request.
I created a wallet, imported the required certificates, and I’m passing the wallet path through p_wallet_path, but I still receive the following error:
ORA-29273: HTTP request failed
ORA-28759: failure to open file (wallet)
Code:
DECLARE
l_response CLOB;
l_json_obj JSON_OBJECT_T;
l_json_array JSON_ARRAY_T;
BEGIN
l_json_array := JSON_ARRAY_T();
l_json_array.append(get_remote_server('NIC'));
l_json_array.append(get_remote_server('NIF'));
l_json_array.append(get_remote_server('FirstName'));
l_json_array.append(get_remote_server('LastName'));
l_json_array.append(get_remote_server('FullName'));
l_json_array.append(get_remote_server('BirthDate'));
l_json_array.append(get_remote_server('Nationality'));
l_json_array.append(get_remote_server('NationalityCode'));
l_json_array.append(get_remote_server('Gender'));
l_json_array.append(get_remote_server('CCNationality'));
l_json_array.append(get_remote_server('AddressXML'));
l_json_array.append(get_remote_server('DocType'));
l_json_array.append(get_remote_server('DocNumber'));
l_json_array.append(get_remote_server('DocNationality'));
l_json_array.append(get_remote_server('DocValidityDate'));
l_json_obj := JSON_OBJECT_T();
l_json_obj.put('attributesName', l_json_array);
l_json_obj.put('token', :token);
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 := 'Bearer ' || :token;
l_response := apex_web_service.make_rest_request(
p_url => 'https://preprod.autenticacao.gov.pt/oauthresourceserver/api/AttributeManager',
p_http_method => 'POST',
p_wallet_path => 'file:///C:/Users/samuel.luis/oracle_wallet/https_wallet',
p_body => l_json_obj.to_string
);
HTP.p(l_response);
END;
Full error message:
ORA-29273 ORA-28759: failure to open file (wallet)
Notes:
The wallet was created on my local machine and contains the certificate chain.
Question:
I understand that APEX/DB cannot access local file system paths.
Does the wallet need to be placed on the database server instead?
If so, where is the correct location to store the wallet in an APEX/ORDS environment and what should the proper p_wallet_path value look like?
Additionally, do I need to configure additional ACL permissions using DBMS_NETWORK_ACL_ADMIN for this external endpoint?
Any guidance would be appreciated.