1 Reply Latest reply on May 26, 2016 1:41 PM by Ed S

    Web Service test with Access Token

    Ed S

      I created a web service and I have generated and authorized the token. When I attempt to run the following via PL/SQL no data is being returned in the response, just header information, however if I turn the access privilege off I am able to successfully view the response with data. Below is my code - am I doing something wrong with the way I am referencing the access token?

       

      accesstoken       VARCHAR2 (200) := 'NNUWWERpOceyuLXV2erjertert..';
          UTL_HTTP.set_wallet (v_wallet_path, v_wallet_password);

       

          l_http_request :=
              UTL_HTTP.begin_request (
                  'https://myapexurl:port/ords/my_workspace/query/result',
                  'GET',
                  'HTTP/1.1');           
           UTL_HTTP.set_header (l_http_request,
                               'Content-Type',
                               'application/json');

       

          UTL_HTTP.set_header (l_http_request,
                               'Content-Length',
                               LENGTH (l_param_list));  
                
          UTL_HTTP.set_header (l_http_request,
                               'Authorization',                       
                            --   'Bearer  + ' || accesstoken);  
         'Bearer ' || accesstoken);  
       
          l_http_response := UTL_HTTP.get_response (l_http_request);
          UTL_HTTP.read_text (l_http_response, l_response_text);
          DBMS_OUTPUT.put_line (l_response_text);