码迷,mamicode.com
首页 > Web开发 > 详细

UTL_HTTP Call a Web Service and Pass Parameters as Part of the URL

时间:2014-11-20 17:04:02      阅读:149      评论:0      收藏:0      [点我收藏+]

标签:blog   http   io   ar   os   sp   for   on   2014   

SET DEFINE OFF
SET SERVEROUTPUT ON

DECLARE
  req UTL_HTTP.REQ;
  resp UTL_HTTP.RESP;
  value VARCHAR2(32767);
  V_DATA VARCHAR2(100) := 'strDate=”31-APR-2012”&strName=”TestName”';
BEGIN
  req := UTL_HTTP.BEGIN_REQUEST('http://myServer/Test/TestWebService.asmx/StartBiztalkProcedure', 'POST', 'HTTP/1.0');
  utl_http.set_header(req, 'Content-Type', 'application/x-www-form-urlencoded');
  utl_http.set_header(req, 'Content-Length', length(v_data));
  utl_http.write_text(req, v_data);
  resp := UTL_HTTP.GET_RESPONSE(req);
  LOOP
     UTL_HTTP.READ_LINE(resp, value, TRUE);
     DBMS_OUTPUT.PUT_LINE(value);
  END LOOP;
  UTL_HTTP.END_RESPONSE(resp);
EXCEPTION
WHEN UTL_HTTP.END_OF_BODY THEN
  UTL_HTTP.END_RESPONSE(resp);
END;
/

UTL_HTTP Call a Web Service and Pass Parameters as Part of the URL

标签:blog   http   io   ar   os   sp   for   on   2014   

原文地址:http://blog.csdn.net/cai_xingyun/article/details/41315851

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!