Re: utl_http.request: HTTP request failed

From: shakespeare <>
Date: Fri, 25 Jan 2008 20:58:15 +0100
Message-ID: <479a3f5a$0$85783$>

"KevinS" <> schreef in bericht
> Hello,
> A utl_http.request('URL') call in a procedure is failing with the
> message
> ORA-29273: HTTP request failed
> ORA-06512: at "SYS.UTL_HTTP", line 1568
> ORA-12545: Connect failed because target host or object does not
> exist
> If I paste the url in a web browser I get a response so why is it
> failing when being launched from the database?
> The problem occurs when I use the machine name and when I use the
> machines IP address.
> Any idea's what the cause might be?
> The version of Oracle being run is
> Thanks

utl_http.request is called at the server, not at the client. So you may have to fill one of the parameters with a proxy address (like If your browser uses a proxy, you should do the same with your procedure. As I recall, it's the second parameter. Btw: this function only returns a part of large pages... If you want to fetch the complete page, you could use something like (this is only partial code...)

req utl_http.req;
resp utl_http.resp;


   req := utl_http.begin_request(url);
   utl_http.set_header(req,'User-Agent',owa_util.get_cgi_env('HTTP_USER_AGENT'));    resp := utl_http.get_response(req);
      utl_http.read_line(resp, VALUE, TRUE);
      htp.p(VALUE);  -- or some way of storing/showing the result

Shakespeare Received on Fri Jan 25 2008 - 13:58:15 CST

Original text of this message