title: Inserting user credentials in HTTP request header
body: <p>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...</p>
  
  <p>Client and Service are both written in Java.</p>
  
  <p>On the client side I do the following:</p>
  
  <pre><code>ExampleImplService service = new ExampleImplService();
  Example port = service.getExampleImplPort();
  
  Map&lt;String, Object&gt; reqContext = ((BindingProvider) port).getRequestContext();
  Map&lt;String, List&lt;String&gt;&gt; reqHeader = new HashMap&lt;String, List&lt;String&gt;&gt;();
  reqHeader.put("Username", Collections.singletonList("user"));
  reqHeader.put("Password", Collections.singletonList("password"));
  reqContext.put(MessageContext.HTTP_REQUEST_HEADERS, reqHeader);
  
  System.out.println(port.somemethod());
  </code></pre>
  
  <p>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.</p>
  
  <p>Any idea what I'm doing wrong?</p>