Bookmark Topic Watch Topic
  • New Topic

401 unauthorized : Need help!

 
Riz Ahmed
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • 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;
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi Riz,
Welcome to JavaRanch. I know you are new here, but we don't allow cross-posting the same topic. So from now on please choose a single forum to post.
Closing this. Please refer to this thread for responses.

Michael Morris
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!