Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

utl_http.request: HTTP request failed

1,292 views
Skip to first unread message

KevinS

unread,
Jan 25, 2008, 12:06:44 PM1/25/08
to
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 10.2.0.2.0.

Thanks

Michael O

unread,
Jan 25, 2008, 1:02:36 PM1/25/08
to
Does your browser use a proxy? Can you browse to the url from a web
browser running on your server?

Michael O
http://blog.crisatunity.com

shakespeare

unread,
Jan 25, 2008, 2:58:15 PM1/25/08
to

"KevinS" <Sea...@googlemail.com> schreef in bericht
news:851047ce-16d0-46a1...@s13g2000prd.googlegroups.com...

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
proxy.yourdomain.com:8080). 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;
begin
utl_http.set_detailed_excp_support(TRUE);
utl_http.set_follow_redirect(no_of_redirects);
utl_http.set_cookie_support(TRUE);
utl_http.set_proxy(l_proxy_url);
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);
LOOP
utl_http.read_line(resp, VALUE, TRUE);
htp.p(VALUE); -- or some way of storing/showing the result
END LOOP;
utl_http.end_response(resp);
end;

Shakespeare


KevinS

unread,
Feb 1, 2008, 4:23:22 AM2/1/08
to
Gents,

Thanks for for your responses.

As it happens I moved the web service I was trying to connect to from
my laptop to a central development server and the problem went away.

I have not had a chance to check to see if the proxy address parameter
would cure the issue as deadlines are too tight for that.

Hopefully soon.

KS

shakespeare

unread,
Feb 1, 2008, 4:40:37 AM2/1/08
to

"KevinS" <Sea...@googlemail.com> schreef in bericht
news:b583f214-f52d-4476...@s12g2000prg.googlegroups.com...

Ok. Thanks for your feedback!

Shakespeare


0 new messages