protected void setHeaders(MessageContext ctx) { ctx.put(ObjectMessageContext.MESSAGE_INPUT, true); Map<String, List<String>> headers = new HashMap<String, List<String>>(); copyRequestHeaders(ctx, headers); ctx.put(GenericMessageContext.HTTP_REQUEST_HEADERS, headers); if (headers.containsKey("Authorization")) { List<String> authorizationLines = headers.get("Authorization"); String credentials = authorizationLines.get(0); String authType = credentials.split(" ")[0]; if ("Basic".equals(authType)) { String authEncoded = credentials.split(" ")[1]; try { String authDecoded = new String(Base64Utility.decode(authEncoded)); String authInfo[] = authDecoded.split(":"); String username = authInfo[0]; String password = authInfo[1]; ctx.put(BindingProvider.USERNAME_PROPERTY, username); ctx.put(BindingProvider.PASSWORD_PROPERTY, password); } catch (Base64Exception ex) { //ignore, we'll leave things alone. They can try decoding it themselves } } } headers = new HashMap<String, List<String>>(); setPolicies(ctx, headers); ctx.put(GenericMessageContext.HTTP_RESPONSE_HEADERS, headers); } protected void setPolicies(MessageContext ctx, Map<String, List<String>> headers) {