您的位置:首页 > 理论基础 > 计算机网络

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

2014-11-20 16:50 246 查看
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;
/
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐