File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes authentication required twice with JAX-WS web service client? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "authentication required twice with JAX-WS web service client?" Watch "authentication required twice with JAX-WS web service client?" New topic
Author

authentication required twice with JAX-WS web service client?

Jason Tyler
Greenhorn

Joined: Jun 18, 2012
Posts: 1
Hello,
I've just created my first JAX-WS web service client. Previously I used Axis2 in each of my projects.

I'm finding that the JAX-WS client is requiring authentication at 2 different places. I created an Axis2 stub for the same web service and it does not exhibit this behavior.

Here is my code (with necessary redactions):


If the WSDL is allowed to be retrieved anonymously, this code runs fine, with the system only asking for authentication at the second point. If anonymous WSDL access is disabled, I get a 401 Unauthorized error at the first noted point in the code. Again, I only have to provide credentials to the Axis2 stub once, no matter how the WSDL access is configured.

How can I either 1) code it such that credentials are passed only once, or, failing that, 2) provide credentials when the system requests the WSDL?

Thanks for any help.

Jason>
 
Don't get me started about those stupid light bulbs.
 
subject: authentication required twice with JAX-WS web service client?
 
Similar Threads
Axis2 - Handlers for SOAP headers
Please improve my code/approach.
JAX-WS versus Axis2, WSDL Implementation
Webservice client code generation using axis2 and eclipse galilio
Web service + xml + java