How to call a Web Soap Service or API from PLSQL

Hello Everyone,

I would like to share one of my codes which allows you to call a web service (soap service) or API through PLSQL. I modified it time to time whenever something new comes up and I still do. I hope it helps you too.

 

5 thoughts on “How to call a Web Soap Service or API from PLSQL

  1. Rudi

    hallo,
    can you give me an example for call a webservice with this function ?

    • Mustafa

      Hi Rudi,

      it could be very easy based on the web service that you want to call.

      select Sf_Call_Web_Service(p_url => ‘www.myWebServiceURL.com/MyService’, p_request => ‘

      • Rudi

        thank you for your quick answer.
        but sorry, i get an error message
        select Sf_Call_Web_Service(p_url => ‘https://api.predic8.de/shop/products/’, p_request => ‘>’) from dual;
        ORA-06553: PLS-306: wrong number or type

  2. Name

    Use this:
    SELECT UPPER ( (SELECT VALUE
    FROM NLS_DATABASE_PARAMETERS
    WHERE parameter = ‘NLS_LANGUAGE’)
    || ‘_’
    || (SELECT VALUE
    FROM NLS_DATABASE_PARAMETERS
    WHERE parameter = ‘NLS_TERRITORY’)
    || ‘.’
    || (SELECT VALUE
    FROM NLS_DATABASE_PARAMETERS
    WHERE parameter = ‘NLS_CHARACTERSET’))
    INTO l_current_charset
    FROM DUAL;

    Instead of ‘AMERICAN_AMERICA.WE8ISO8859P9’.

    Also do not set ‘Content-Length’ when you are using ‘chunked’ (doing that might give you 400 bad request responses).

    • Mustafa

      Hi,
      thanks for your comment. I was a little bit lazy about charset, as you pointed out it could be read from db. I am not sure about Content-length, I never got a bad request error and I put them for a reason but this is an old code maybe I should review it.

Leave a Reply to Rudi Cancel reply

Your email address will not be published. Required fields are marked *