How to call REST Web service from Oracle Scale System
Welcome to Appslead,
Today we will just call web service to delete DO from Order management super user Responsibility and we will make personalization to show error message if the result of the web service is false. If it is true it will not do anything and the process will pass normally. This web service will get IN PARAMETER P_LINE_ID.
Step 1
Please make package which will contain your code:
--Specification:- CREATE OR REPLACE PACKAGE APPS.XX_DO_WEBSERVICE AS FUNCTION XX_DO_WB(P_LINE_ID NUMBER) return VARCHAR2; END XX_DO_WEBSERVICE; --Body:- CREATE OR REPLACE PACKAGE BODY APPS.XX_DO_WEBSERVICE AS FUNCTION XX_DO_WB(P_LINE_ID NUMBER) RETURN VARCHAR2 IS req UTL_HTTP.REQ; resp UTL_HTTP.RESP; weatherstring VARCHAR2(32767); weatherxml XMLTYPE; tempxml xmltype; temp varchar2(32767); extractstring varchar2(2000) := '//temperature/@value'; Do_number varchar2(250) := P_LINE_ID; begin req := UTL_HTTP.BEGIN_REQUEST('http://<SERVER IP : PORT>/ebs-portal/rest/LongShippingScale/DeleteDOFromScale?parametersMap=' || Do_number); --you will get this link from your DBA Adminstrator to complete your task. resp := UTL_HTTP.GET_RESPONSE(req); UTL_HTTP.READ_LINE(resp, weatherstring, TRUE); UTL_HTTP.END_RESPONSE(resp); dbms_output.put_line( upper(weatherstring)); RETURN(upper(weatherstring)); END XX_DO_WB; END XX_DO_WEBSERVICE;Step 2 Condition:- Action:- Step 3 Please go to Order Management Super User > Sales Order Now you can see How to test your Web Service using the personalization. Click OK then write reason and you will see your error message if the Web service result come back with false. Best regards… Abdelkareem Mousa