Open armandoplascencia opened 2 years ago
I can be reached at aplascencia@misorobotics.com or via 818-645-5295 if questions arrise.
declare C_MAX_ROWS number := null;
l_response clob;
l_url varchar2(32767);
l_finish boolean := false;
l_rows_loaded number := 0;
l_pages_fetched number := 0;
begin l_url := :SAMPLE_ENDPOINT_URL;
delete from "EBA_RESTDEMO_SAMPLE_EMP";
while not l_finish loop
l_response := apex_web_service.make_rest_request(
p_url => l_url,
p_http_method => 'GET');
insert into "EBA_RESTDEMO_SAMPLE_EMP" (
select
x.EMPNO,
x.ENAME,
x.JOB,
x.MGR,
to_date( x.HIREDATE, 'YYYY-MM-DD"T"HH24:MI:SS"Z"' ) as HIREDATE,
x.SAL,
x.DEPTNO,
x.RN
from xmltable(
'/json/items/row'
passing apex_json.to_xmltype( l_response )
columns
EMPNO NUMBER path 'empno',
ENAME VARCHAR2(4000) path 'ename',
JOB VARCHAR2(4000) path 'job',
MGR NUMBER path 'mgr',
HIREDATE VARCHAR2(4000) path 'hiredate',
SAL NUMBER path 'sal',
DEPTNO NUMBER path 'deptno',
RN NUMBER path 'rn'
) x
);
l_rows_loaded := l_rows_loaded + nvl( sql%rowcount, 0 );
l_pages_fetched := l_pages_fetched + 1;
if l_rows_loaded >= C_MAX_ROWS then
l_finish := true;
end if;
select
x.next_page into l_url
from xmltable(
'/json'
passing apex_json.to_xmltype( l_response )
columns
next_page varchar2(500) path 'next/_ref'
) x;
if l_url is null then l_finish := true; end if;
end loop;
:P11_PAGES_FETCHED := l_pages_fetched;
:P11_ROWS_LOADED := l_rows_loaded;
end; ------------------------------- end of button code. ----------
select NAME as card_title,
URL,
LAST_STATUS,
case
when last_status is null then 'fa-question'
when last_status = 'OK' then 'fa-check'
else 'fa-exception'
end as card_icon,
case
when last_status is null then 'u-color-29'
when last_status = 'OK' then 'u-color-35'
else 'u-color-39'
end as card_color,
case
when last_status='OK' then 'OK'
when last_status='ERROR_ACL' then 'Network Access Control List (ACL)'
when last_status='ERROR_CERT' then 'SSL Certificate error (Wallet)'
when last_status='ERROR_NETWORK' then 'Networking issue (e.g. Proxy Server)'
when last_status like 'ERROR_HTTP%' then 'HTTP Error ' || substr( last_status, 12 )
when last_status like 'ERROR_OTHER%' then 'Other Error: ' || substr( last_status, 13 )
else 'Other Error'
end as card_text,
url as card_subtext
from miso.EBA_RESTDEMO_SAMPLE_URLS where name != 'ORDS EMP';
"CARD_TITLE" "URL" "LAST_STATUS" "CARD_ICON" "CARD_COLOR" "CARD_TEXT" "CARD_SUBTEXT" "Github API" "https://api.github.com" "ERROR_OTHER_ORA-01031: insufficient privileges" "fa-exception" "u-color-39" "Other Error: ORA-01031: insufficient privileges" "https://api.github.com"
WHAT PRIVS ARE MISSING?
https://gd49ef7d5e3cd2d-db202110212330.adb.us-phoenix-1.oraclecloudapps.com/ords/miso/hr/employees/ works when I set it as the default path for local rest file source
did this.
BEGIN DBMS_NETWORK_ACL_ADMIN.APPEND_HOST_ACE( host => '*', ace => XS$ACE_TYPE( privilege_list => XS$NAME_LIST('http'), principal_name => APEX_APPLICATION.g_flow_schema_owner, principal_type => XS_ACL.ptype_db ), private_target => true); END; / BEGIN APEX_INSTANCE_ADMIN.SET_PARAMETER('MAX_WEBSERVICE_REQUESTS', '1000000'); COMMIT; END; /
SELECT UTL_HTTP.REQUEST(url => 'https://api.github.com', https_host => 'api.github.com') FROM dual;
SELECT UTL_HTTP.REQUEST(url => 'https://gd49ef7d5e3cd2d-db202110212330.adb.us-phoenix-1.oraclecloudapps.com/ords/miso/hr/employees/', https_host => 'gd49ef7d5e3cd2d-db202110212330.adb.us-phoenix-1.oraclecloudapps.com') FROM dual;
ORA-29273: HTTP request failed ORA-06512: at "SYS.UTL_HTTP", line 1620 ORA-29024: Certificate validation failure ORA-06512: at "SYS.UTL_HTTP", line 380 ORA-06512: at "SYS.UTL_HTTP", line 1560 ORA-06512: at line 1
two things:
Here is general documentation about accessing REST Services from APEX on Autonomous DB. https://docs.oracle.com/en/cloud/paas/autonomous-database/adbsa/apex-web-services.html#GUID-DA24C605-384D-4448-B73C-D00C02F5060E
So my recommendation is to ...
Based on your reply, the sample app is not possible to run? As i'm experiencing permissions issues, I assume it possible to run this app once I address permissions, but I dont know what permissions are missing. The restapi from HR.EMP should work in the sample restapi app. Can you help me find the right resource to assist, support has been no help. You have been wonderful ty !!!.
The downloaded app from the apex app repository has a PROXY SERVER ENTRY DEFINED !! THIS NEEDS TO BE REMOVED inorder for the app to run !! PLEASE DOCUMENT THIS ASAP , I SPENT 2 WEEKS TRYING TO GET THIS TO WORK. THIS was rediculous that it took this long and it took me to figure it out. !!!!
The application had a Proxy Server defined (Shared Components > Application Definition Attributes > Proxy Server). www-proxy.us.oracle.com:80 .
On ADB, a proxy server must not be configured. Please clear out proxy server settings in application attributes in future downloads.
Thank you for this - it was not clear to me that you're using the Sample REST Services application. I will have a look right now.
@cczarski-de, is there an update on how to proceed? We couldn't install any app on the OCI ADB!
Appreciate your help in advance!
Thanks
please raise a new question, instead appending a new question to an existing thread - "we couldn't install any app on the OCI ADB" sounds like a completely different issue, compared to what this issue is about.
Note, that ADB still runs on APEX 21.1 (!) - so you need to make sure to download the correct application for APEX 21.1, by selecting the APEX 21.1 branch before downloading.
The issue was fixed after I found and removed a proxy setting in the application definition. Once it was removed, the app worked fine. I still have not found the old Rest Client App that created plsql for parsing of rest end points. Do you have any updates as to When will 21.1 be upgraded to 21.2 on OCI? Thanks again. Please make a note on the download page to remove the proxy when performing installations. This appears to be a config issue that is easily solved if you place a one liner on the instructions page. Where can I find prior apex applications prior to 21.1. I Cant find the old install zips from 4.2, 5, ets. I want some of those apps back so I can install them on 21.1 (for now) and attempt to fix any issues if they dont run on 21.1 oci . Please help me find all prior apex applications.
On Mon, Mar 7, 2022 at 12:43 AM Carsten Czarski @.***> wrote:
please raise a new question, instead appending a new question to an existing thread - "we couldn't install any app on the OCI ADB" sounds like a completely different issue, compared to what this issue is about.
Note, that ADB still runs on APEX 21.1 (!) - so you need to make sure to download the correct application for APEX 21.1, by selecting the APEX 21.1 branch before downloading.
— Reply to this email directly, view it on GitHub https://github.com/oracle/apex/issues/25#issuecomment-1060334348, or unsubscribe https://github.com/notifications/unsubscribe-auth/AV2EZNO2ZSDHYXKSKBGQMZ3U6W6RRANCNFSM5PASSQNA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you authored the thread.Message ID: @.***>
@cczarski-de, I did download the 21.1 version from the branch. However, when installing it, I'm getting the below error
I'm not sure if it is something related to the proxy that is discussed in this thread. I can sure raise a new question if it is not relevant to what is being discussed here.
I'm having this issue when trying to install many of the 21.1 version apps. Not sure if I have to config any network ACL within the ADB.
Thanks for your help!
which application did you try out? I don't think that this is related to the proxy topic we discussed above.
UPDATES: *** ISSUE FIX BY REMOVEING PROXY IN APP DEFINITIONS LEFT THERE FROM APEX.ORACLE.COM USAGE* UPDATES: *** ISSUE FIX BY REMOVEING PROXY IN APP DEFINITIONS LEFT THERE FROM APEX.ORACLE.COM USAGE* UPDATES: *** ISSUE FIX BY REMOVEING PROXY IN APP DEFINITIONS LEFT THERE FROM APEX.ORACLE.COM USAGE* UPDATES: *** ISSUE FIX BY REMOVEING PROXY IN APP DEFINITIONS LEFT THERE FROM APEX.ORACLE.COM USAGE* UPDATES: *** ISSUE FIX BY REMOVEING PROXY IN APP DEFINITIONS LEFT THERE FROM APEX.ORACLE.COM USAGE* UPDATES: *** ISSUE FIX BY REMOVEING PROXY IN APP DEFINITIONS LEFT THERE FROM APEX.ORACLE.COM USAGE*
I am running on oracle oci cloud Application Express 21.1.7
possibly the issue is with the call to https://gd49ef7d5e3cd2d-db202110212330.adb.us-phoenix-1.oraclecloudapps.com/ords/wwv_flow.accept
When I run the local rest data "load data", I get ORA-01031: insufficient privileges
Contact your application administrator. Details about this incident are available via debug id "57028". Technical Info (only visible for developers)
UPDATES: *** ISSUE FIX BY REMOVEING PROXY IN APP DEFINITIONS LEFT THERE FROM APEX.ORACLE.COM USAGE*