Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SENDING SMS USING HTTPS instead of HTTP

Bluesky_18011971Sep 24 2020 — edited Sep 25 2020

Dear Gurus

Currently I am using the following code to send SMS with 3rd party celluler company. Now the celluler company change his API and using HTTPS instead of HTTP.

In HTTP we are working fine. Now When I change with HTTPS, My system is not reading the following code

Please Help me in this regard.

    HTTP_REQ  UTL_HTTP.REQ ;

    HTTP_RESP UTL_HTTP.RESP ;

    URL_TEXT  VARCHAR2 (32767);

    URL     VARCHAR2 (5000) ;

    SMS_MSG VARCHAR2 (5000) ;

    MOBILE VARCHAR2 (25) ;

    MASK VARCHAR2 (30) ;

   

    

BEGIN

SMS_MSG := 'Congratulation Finally your SMS system running'

MOBILE := '999999999' ;

MASK := UTL_URL.Escape('business',TRUE);

DBMS_OUTPUT.PUT_LINE(SMS_MSG);

  DBMS_OUTPUT.ENABLE(1000000);

--Based on your service provider, the following link format may differ from

--What we have specified below!   

URL := 'https://connect.abcdef.com/sendsms_url.html?Username=999999995&Password=123&From='||MASK||'&To='||Mobile||'&Message='||UTL_URL.Escape(SMS_MSG,TRUE);

    

    HTTP_REQ:= UTL_HTTP.BEGIN_REQUEST(URL) ;

   

    UTL_HTTP.SET_HEADER(HTTP_REQ, 'User-Agent', 'Mozilla/4.0');

   

    HTTP_RESP:= UTL_HTTP.GET_RESPONSE(HTTP_REQ);

    -- Process Request

    LOOP

        BEGIN

            URL_TEXT := null;

            UTL_HTTP.READ_LINE(HTTP_RESP, URL_TEXT, TRUE);

            DBMS_OUTPUT.PUT_LINE(URL_TEXT);

            EXCEPTION

                WHEN OTHERS THEN EXIT;

        END;

    END LOOP;

    UTL_HTTP.END_RESPONSE(HTTP_RESP);

END;

Comments
Post Details
Added on Sep 24 2020
5 comments
540 views