title: Web service client needs to add type attribute to password security header
body: <p>I'm writing a .NET client (WCF) that will consume a web-service that is implemented using Apache CXF (Java) and amazingly enough it's incredibly hard have WCF to set the <strong>Type</strong> attribute of the <strong>Password</strong> tag to <strong>PasswordText</strong>. I.e I would like the SOAP header to look something like:</p>
  
  <pre><code>  &lt;wsse:Security soap:mustUnderstand="true" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"&gt;
       &lt;wsse:UsernameToken wsu:Id="UsernameToken-11" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"&gt;
          &lt;wsse:Username&gt;test&lt;/wsse:Username&gt;
          &lt;wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText"&gt;a287645857cfaaddf82e2d333651b3e0&lt;/wsse:Password&gt;
          &lt;wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"&gt;oKGlwEkbkhYJH6upsbiqeQ==&lt;/wsse:Nonce&gt;
          &lt;wsu:Created&gt;2011-10-25T13:10:11.958Z&lt;/wsu:Created&gt;
       &lt;/wsse:UsernameToken&gt;
    &lt;/wsse:Security&gt;
  </code></pre>
  
  <p>but the actual header looks like:</p>
  
  <pre><code>  &lt;o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"&gt;
       &lt;o:UsernameToken u:Id="uuid-5acb0b47-1b52-4535-bfaf-b9e76621b7eb-1"&gt;
          &lt;o:Username&gt;test&lt;/o:Username&gt;
          &lt;o:Password&gt;a287645857cfaaddf82e2d333651b3e0&lt;/o:Password&gt;
       &lt;/o:UsernameToken&gt;
    &lt;/o:Security&gt;
  </code></pre>
  
  <p>As you can see the Type attribute is missing from the Password tag. Some research on the web seems to indicate that I perhaps have to write an interceptor to fix this. I figured that there was a simple solution, i.e. config setting, to fix this but maybe there is not. Anyhow, I'm hoping for some clarifications by posting this question.</p>
  
  <p>The WS server rejects the request because of the missing Type attribute. Some function checking for BSP spec. compliance (not sure what this is) throws an exception.</p>
  
  <p>Regards, Ola</p>