Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

401 unauthorized error

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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;
 
In the renaissance, how big were the dinosaurs? Did you have tiny ads?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic