You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Robert Dodier <ro...@gmail.com> on 2013/07/26 05:39:37 UTC

Having trouble submitting credentials for Basic authentication

Hello,

I am working with Axis2 1.6.1 and I have a web service
client which was generated via wsdl2java.sh.

Here's the code I've added to assign the username and password:

        HttpTransportProperties.Authenticator A = new
HttpTransportProperties.Authenticator ();
        A.setUsername ("myusername");
        A.setPassword ("mypassword");

        _serviceClient.getOptions ().setProperty
(HTTPConstants.AUTHENTICATE, A);

The server wants Basic authentication, which seems to
be submitted successfully, but the server still returns 401 --
unauthorized after the client responds to the authentication
challenge. Can anyone tell what is going on?

Here is a link to the relevant bits of the log file:
http://pastebin.com/wG80PS7k
I see that the client first POSTs without authentication which is
rejected by the server, as expected, and then the client POSTs
again with Basic authentication. But that second attempt fails
too. The return code is 401 and the accompanying error message
sent by the server says "100 - System Error occured".

I guess it's possible I've gotten the user name & password wrong --
should I expect a more informative error message? or not?

Thanks for any light you can shed on this problem.

Robert Dodier

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org