This week's book giveaway is in the Testing forum. We're giving away four copies of The Way of the Web Tester: A Beginner's Guide to Automating Tests and have Jonathan Rasmusson on-line! See this thread for details.
HTTP authentication for web service call from servlet fails
posted 1 year ago
I'm developing a JavaServlet that makes some calls to a Web Service. Before trying this calls on my servlet I did it in a Java standalone class and it worked just fine. Here's the code (I used netbeans web service client generation):
Now when I try to move this call to my servlet it gives me this error:
Server returned HTTP response code: 401
But i'm providing the username and the password as I did it in my Java class (as shown above). Is there something I need to do differently?