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
http://blog.crisatunity.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
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
Ok. Thanks for your feedback!
Shakespeare