I'm trying to insert user credentials into an HTTP request header which is then sent via https to a web service, which in turn reads them for authorization purposes...
Client and Service are both written in Java.
On the client side I do the following:
ExampleImplService service = new ExampleImplService();
Example port = service.getExampleImplPort();
Map<String, Object> reqContext = ((BindingProvider) port).getRequestContext();
Map<String, List<String>> reqHeader = new HashMap<String, List<String>>();
reqHeader.put("Username", Collections.singletonList("user"));
reqHeader.put("Password", Collections.singletonList("password"));
reqContext.put(MessageContext.HTTP_REQUEST_HEADERS, reqHeader);
System.out.println(port.somemethod());
If I dump the reqContext after my additions programmatically I see the added headers. But via tcpmon, I can see, that they are not send to the web service... Naturally I can't find them anywhere in the web service either.
Any idea what I'm doing wrong?