Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

HTTP authentication for web service call from servlet fails  RSS feed

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm developing a Java Servlet 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?

Thanks in advance.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!