Hi!
We are using Basic Authentication mechansim and are encrypting the username and password to a single string. We need to add this string to request header.
I tried the following code:
Map<String,String>headers = new HashMap<String,String>();
headers.put("Authorization","Basic encryptedString");
BindingProvider bp = ((BindingProvider) port);
bp.getRequestContext().put(MessageContext.HTTP_REQUEST_HEADERS, headers);
But its still giving me error:
Exception in
thread "main" javax.xml.ws.WebServiceException: request requires HTTP authentication: Unauthorized