• Post Reply Bookmark Topic Watch Topic
  • New Topic

401 unauthorized error

 
Riz Ahmed
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I'm trying to call a standard HTTP servlet deployed on Tomcat 4.05 with the following PL/SQL call and get a 401 unauthorized error.
The Servlet is reachable via the browser @'http://localhost:8080/XMLMessaging/XMLBannerServlet.
Please advise.

declare
conn utl_tcp.connection;
XMLDoc VARCHAR2(32767);
value VARCHAR2(2000);
http_req utl_http.req;
http_resp utl_http.resp;
begin
XMLDOC := '<Rizwan> Hi </Rizwan>';
http_req := utl_http.begin_request('http://localhost:8080/XMLMessaging/XMLBannerServlet', 'GET','HTTP/1.0');

utl_http.set_header(http_req, 'Content-Type', 'text/xml');
http_resp := utl_http.get_response(http_req);
LOOP
utl_http.read_line(http_resp, value, TRUE);
dbms_output.put_line(value);
END LOOP;
utl_http.end_response(http_resp);
EXCEPTION
WHEN utl_http.end_of_body THEN
utl_http.end_response(http_resp);
end;
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!