This discussion is archived
3 Replies Latest reply: Nov 2, 2010 4:57 AM by abhishek476 RSS

UTL_HTTP.request_pieces:::: response --> UNDER CONSTRUCTION......Why???

abhishek476 Newbie
Currently Being Moderated
Hi All,

I'm trying to use the UTL_HTTP utility (for the first time :)), have read a few documents and tried one example. The one i tried is as below:
DECLARE
x utl_http.html_pieces;
len PLS_INTEGER;
proxy varchar2(100):= null;
no_proxy_domains varchar2(100):= null;
BEGIN
-----UTL_HTTP.set_follow_redirect(5);
UTL_HTTP.set_proxy ('***.**.**.**',****);
UTL_HTTP.set_response_error_check(TRUE);
UTL_HTTP.set_detailed_excp_support(TRUE);
x := utl_http.request_pieces('http://www.google.com/', 100);
dbms_output.put_line(x.count || ' pieces were retrieved.');
dbms_output.put_line('with total length ');
IF x.count < 1 THEN
dbms_output.put_line('0');
ELSE
len := 0;
FOR i in 1..x.count LOOP
len := len + length(x(i));
dbms_output.put_line(x(i));
END LOOP;
dbms_output.put_line(len);
END IF;
UTL_HTTP.get_proxy (proxy, no_proxy_domains);
dbms_output.put_line(proxy||'--'||no_proxy_domains);
END;
The output is coming as:
1 pieces were retrieved.
with total length
<html>

<head>
<meta HTTP-EQUIV="Content-Type" Content="text/html; charset=Windows-1252">


<title ID=titletext>Under Construction</title>
</head>

<body bgcolor=white>
<table>
<tr>
<td ID=tableProps width=70 valign=top align=center>
<img ID=pagerrorImg src="pagerror.gif" width=36 height=48>
<td ID=tablePropsWidth width=400>

<h1 ID=errortype style="font:14pt/16pt verdana; color:#4e4e4e">
<P ID=Comment1><!--Problem--><P ID="errorText">Under Construction</h1>

<P ID=Comment2><!--Probable causes:<--><P ID="errordesc"><font style="font:9pt/12pt verdana; color:black">
The site you are trying to view does not currently have a default page. It may be in the process of being upgraded >and configured.
<P ID=term1>Please try this site again later. If you still experience the problem, try contacting the Web site >administrator.

<hr size=1 color="blue">

<P ID=message1>If you are the Web site administrator and feel you have received this message in error, please see >&quot;Enabling and Disabling Dynamic Content&quot; in IIS Help.

<h5 ID=head1>To access IIS Help</h5>
<ol>
<li ID=bullet1>Click <b>Start</b>, and then click <b>Run</b>.
<li ID=bullet2>In the <b>Open</b> text box, type <b>inetmgr</b>. IIS Manager appears.
<li ID=bullet3>From the <b>Help</b> menu, click <b>Help Topics</b>.
<li ID=bullet4>Click <b>Internet Information Services</b>.</ol>
</td>
</tr>
</table>

</body>
</html>

1433
***.**.**.**--****
I'm have no idea of why this "Under Construction" tag is coming and i could not understand any of the reasons mentioned for the same. I have tried GOOGLing for the reason but to no effect.

All i can conclude from the above example is that either there is some problem with proxy i'm giving or i've not understood the UTL_HTTP concept properly.

Looking forward for any suggestion or help!!!

Edited by: user11089213 on Nov 2, 2010 4:08 AM
  • 1. Re: UTL_HTTP.request_pieces:::: response --> UNDER CONSTRUCTION......Why???
    660376 Explorer
    Currently Being Moderated
    I don't need a proxy, so I commented out the set_proxy line and executed:
    DECLARE
        x                UTL_HTTP.HTML_PIECES;
        len              PLS_INTEGER;
        proxy            VARCHAR2(100):= NULL;
        no_proxy_domains VARCHAR2(100):= NULL;
    BEGIN
        -----UTL_HTTP.SET_FOLLOW_REDIRECT(5);
    --    UTL_HTTP.SET_PROXY ('***.**.**.**',****);
        UTL_HTTP.SET_RESPONSE_ERROR_CHECK(TRUE);
        UTL_HTTP.SET_DETAILED_EXCP_SUPPORT(TRUE);
    
        x := UTL_HTTP.REQUEST_PIECES('http://www.google.com/', 100);
    
        DBMS_OUTPUT.PUT_LINE(x.count || ' pieces were retrieved.');
        DBMS_OUTPUT.PUT_LINE('with total length ');
    
        IF x.count < 1 THEN
            DBMS_OUTPUT.PUT_LINE('0');
        ELSE
            len := 0;
            FOR i in 1..x.count LOOP
                len := len + LENGTH(x(i));
                DBMS_OUTPUT.PUT_LINE(x(i));
            END LOOP;
            DBMS_OUTPUT.PUT_LINE(len);
        END IF;
    
        UTL_HTTP.GET_PROXY (proxy, no_proxy_domains);
        DBMS_OUTPUT.PUT_LINE(proxy || '--' || no_proxy_domains);
    END;
    /
    It worked fine for me. Maybe the proxy you're using is messing up the results.
  • 2. Re: UTL_HTTP.request_pieces:::: response --> UNDER CONSTRUCTION......Why???
    abhishek476 Newbie
    Currently Being Moderated
    Hi,

    I'm still getting the same error, even if i dont use the proxy command!!!

    I think i'll have to use proxy as the client for whom i'm workin is having its own network established and for any external connections even our web browser is configured to go thru a Proxy.

    Anyways, thanks for the response!!! Hopefully will get some other responses as well!!
  • 3. Re: UTL_HTTP.request_pieces:::: response --> UNDER CONSTRUCTION......Why???
    Saubhik Guru
    Currently Being Moderated
    How are you mentioning the proxy with port ? you don't need to give original address and port, just use xyxabc.com:8888 etc. From your example UTL_HTTP.set_proxy (124.34.55.26',?????);

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points