1
By making a request
the determined endpoint
, error occurs below
CREATE OR REPLACE PROCEDURE CALL_REST_WEBSERV_POST_METHOD
AS V_WLT_DIRECTORY
VARCHAR2(4000) := 'file:/oradisk/app/oracle/product/11.2.0.4/db_1/wallet/Cert_occ_17112019.p7b';
V_WLT_PASSWORD VARCHAR2(40) := 'testeosc1';
V_REQUEST UTL_HTTP.REQ;
V_RESPONSE UTL_HTTP.RESP;
V_TEXT VARCHAR2(2000);
CONTENT VARCHAR2(4000) :='{
"values": [
{
"key": "occ-env",
"value": "https://admin-admin",
"enabled": true
},
{
"key": "occ-user",
"value": "meuusuario@tofodido",
"enabled": true
},
{
"key": "occ-password",
"value": "xxxxxxx",
"enabled": true
},
{
"key": "occ-key",
"value": "000000",
"description": {
"content": "",
"type": "text/plain"
},
"enabled": true
}
],
}' ;
BEGIN
DBMS_OUTPUT.PUT_LINE('Passou 1');
UTL_HTTP.SET_WALLET(V_WLT_DIRECTORY
,V_WLT_PASSWORD);
DBMS_OUTPUT.PUT_LINE('Passou 2');
V_REQUEST := UTL_HTTP.BEGIN_REQUEST('https://meu_endpointblablabla/'
,'POST'
,'HTTP/1.1');
DBMS_OUTPUT.PUT_LINE('Passou 3');
UTL_HTTP.SET_HEADER(V_REQUEST, 'Content-Type', 'application/x-www-form-urlencoded');
UTL_HTTP.SET_HEADER(V_REQUEST, 'Authorization', 'OAuth');
UTL_HTTP.SET_HEADER(V_REQUEST, 'Content-Length', LENGTH(CONTENT));
UTL_HTTP.WRITE_TEXT(V_REQUEST, CONTENT);
V_RESPONSE := UTL_HTTP.GET_RESPONSE(V_REQUEST);
DBMS_OUTPUT.PUT_LINE('Resposta status : ' || V_RESPONSE.STATUS_CODE);
DBMS_OUTPUT.PUT_LINE('Resposta rasão: ' || V_RESPONSE.REASON_PHRASE);
LOOP
BEGIN
UTL_HTTP.READ_TEXT(V_RESPONSE, V_TEXT);
DBMS_OUTPUT.PUT_LINE(V_TEXT);
EXCEPTION
WHEN UTL_HTTP.END_OF_BODY THEN
NULL;
END;
EXIT WHEN V_TEXT IS NULL;
END LOOP;
UTL_HTTP.END_RESPONSE(V_RESPONSE);
END;
Has anyone ever come across this problem? Thank you.
Hello George, good morning. We gave the permissions for the file and we had no success in the operation. The problem with changing Wallet’s location is that we have two more certificates for Oracle Sales Cloud and Sales Force. If you change, both systems will stop working because you will lose the address already assigned.
– LordDual
@Johnleenda put a few more checks, Check if something will solve your problem.
– George Wurthmann
None of the Methods worked unfortunately. :(
– LordDual
George came here to say that now it worked.. we took on the project and worked out 3 solution
– LordDual
Good @Goldenboy, I’m glad I helped you! When possible mark as answer since solved your problem. And if possible give the vote to keep me encouraged! kkk ;)
– George Wurthmann
done, thank you very much for the same help
– LordDual