过程PL / SQL调用Web服务休息

时间:2017-09-08 10:03:33

标签: rest web-services plsql plsqldeveloper

我必须调用PL / SQL过程this Web服务休息。

我做了这个脚本来调用这个Web服务休息并下载表:

{

DECLARE
  l_param_list     VARCHAR2(512);

  l_http_request   UTL_HTTP.req;
  l_http_response  UTL_HTTP.resp;

  l_response_text  VARCHAR2(32767);
BEGIN


  -- service's input parameters
  l_param_list:=:xxx;
  --l_param_list := FND_PROFILE.VALUE('XXCC_LINK_BANCA_ITALIA_CAMBIO'); 


  DBMS_OUTPUT.put_line('link:'||l_param_list);

  -- preparing Request...
  l_http_request := UTL_HTTP.begin_request (l_param_list
                                          , 'POST'
                                          , 'HTTP/1.1');

  -- ...set header's attributes
  UTL_HTTP.set_header(l_http_request, 'Content-Type', 'application/x-www-form-urlencoded');
  UTL_HTTP.set_header(l_http_request, 'Content-Length', LENGTH(l_param_list));

  -- ...set input parameters
  UTL_HTTP.write_text(l_http_request,l_param_list);

  -- get Response and obtain received value
  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);

  -- finalizing
  UTL_HTTP.end_response(l_http_response);

EXCEPTION
  WHEN UTL_HTTP.end_of_body 
    THEN UTL_HTTP.end_response(l_http_response);  
END;}

如何将此服务的参数声明为initDayinitMonthrefCur

1 个答案:

答案 0 :(得分:0)

POST参数作为正文的一部分传递(即write_text()调用)..请参阅How are parameters sent in an HTTP POST request?了解一般过程