1 Reply Latest reply on Sep 25, 2015 5:23 AM by Kiran Pawar

    APEX_WEB_SERVICE Proxy Override example

    PROGRAMMER_JB

      Hi All,

       

      Does anyone have a working example using APEX_WEB_SERVICE, with a Proxy Override?  or Can point to documentation explaining how to use Proxy Override when making anAPEX_WEB_SERVICE call, preferably RESTful.

       

       

      Thanks,

      James

        • 1. Re: APEX_WEB_SERVICE Proxy Override example
          Kiran Pawar

          Hi James,

          PROGRAMMER_JB wrote:


          Does anyone have a working example using APEX_WEB_SERVICE, with a Proxy Override?  or Can point to documentation explaining how to use Proxy Override when making anAPEX_WEB_SERVICE call, preferably RESTful.

               Refer the APEX_WEB_SERVICE.MAKE_REST_REQUEST documentation which says:

          p_proxy_override : The proxy to use for the request. The proxy supplied overrides the proxy defined in the application attributes.

               This means if you have already specified proxy in the APEX application attributes which you want to override / you want to specify the proxy for the current REST web service request you can specify the proxy server in the p_proxy_override attribute of the above APEX API.

               Let's take example given in the documentation. If you have specified proxy in application attributes as "proxy1.myorg.com" then when you invoke a REST web service like this:

          declare
          
              l_clob clob;
          
          begin
          
              l_clob := apex_web_service.make_rest_request(
                  p_url => 'http://us.music.yahooapis.com/video/v1/list/published/popular',
                  p_http_method => 'GET',
                  p_parm_name => apex_util.string_to_table('appid:format'),
                  p_parm_value => apex_util.string_to_table('xyz:xml'));
          
          end;
          

               The above code will use the proxy specified in the application attributes.

               If you want to use say different proxy say "proxy2.myorg.com" instead of using APEX application level proxy, then you can specify it in p_proxy_override

          declare
          
              l_clob clob;
          
          begin
          
              l_clob := apex_web_service.make_rest_request(
                  p_url => 'http://us.music.yahooapis.com/video/v1/list/published/popular',
                  p_http_method => 'GET',
                  p_proxy_override => 'proxy2.myorg.com',
                  p_parm_name => apex_util.string_to_table('appid:format'),
                  p_parm_value => apex_util.string_to_table('xyz:xml'));
          
          end;
          

           

          Regards,

          Kiran