Vedang Vedang - 26 days ago 5
Java Question

How do I retrieve credential passed by user in soap wsdl Java Webservice

I am sending my credentials using,

Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication("username", "password".toCharArray());
}
});


My question is now how can I retrieve this credentials in Soap webservice Java?

Answer

Got solution,

ArrayList<String> authList = (ArrayList<String>) http_headers.get("Authorization");

It returns Credentials in Base64.