49.1.3 Setting Cookies and HTTP Headers

Set cookies and HTTP headers that should be sent along with a Web Service request by populating the globals g_request_cookies and g_request_headers before the process that invokes the Web Service.

The following example populates the globals to send cookies and HTTP headers with a request.

FOR c1 IN (select seq_id, c001, c002, c003, c004, c005, c006, c007
            FROM apex_collections
            WHERE collection_name = 'P31_RESP_COOKIES' ) LOOP
  apex_web_service.g_request_cookies(c1.seq_id).name := c1.c001;
  apex_web_service.g_request_cookies(c1.seq_id).value := c1.c002;
  apex_web_service.g_request_cookies(c1.seq_id).domain := c1.c003;
  apex_web_service.g_request_cookies(c1.seq_id).expire := c1.c004;
  apex_web_service.g_request_cookies(c1.seq_id).path := c1.c005;
  IF c1.c006 = 'Y' THEN
    apex_web_service.g_request_cookies(c1.seq_id).secure := TRUE;
  ELSE
    apex_web_service.g_request_cookies(c1.seq_id).secure := FALSE;
  END IF;
  apex_web_service.g_request_cookies(c1.seq_id).version := c1.c007;
END LOOP;
 
FOR c1 IN (select seq_id, c001, c002
            FROM apex_collections
            WHERE collection_name = 'P31_RESP_HEADERS' ) LOOP
  apex_web_service.g_request_headers(c1.seq_id).name := c1.c001;
  apex_web_service.g_request_headers(c1.seq_id).value := c1.c002;
END LOOP;