title: .NET client authentication and SOAP credential headers for a CXF web service
body: <p><strong>SCENARIO</strong></p>
  
  <p>I have to access a web service with a .NET client.
  The service is an Apache CXF Web Service.
  Username and password authentication is required.
  I have created the proxy.
  I have set up the credential.</p>
  
  <pre><code>MyServiceReference proxy = new MyServiceReference();
  proxy.Credentials = new NetworkCredential("username", "password");
  string res = proxy.Method1();
  </code></pre>
  
  <p>When I run the client, the following exception is thrown:</p>
  
  <pre><code>System.Web.Services.Protocols.SoapHeaderException: An error was discovered processing the &lt;wsse:Security&gt; header
  </code></pre>
  
  <p>The service publisher told me that the credentials are not present in the SOAP headers.
  So, I guess that <a href="http://msdn.microsoft.com/en-us/library/system.net.iwebproxy.credentials%28v=vs.110%29.aspx" rel="nofollow">IWebProxy.Credentials</a> is not the correct way to set up the authentication.</p>
  
  <p><strong>QUESTION</strong></p>
  
  <p>So, how can I set up the SOAP header required for the authentication?</p>