title: Authentication with Soap service in C# console
body: <p>I am trying to connect to a soap service(wsdl) from the console in C#.
  My code is fairly simple, I added the wsdl to the project as a service reference, and the proxy class(?) was created as expected.</p>
  
  <p>The service use a authentication key per message, and i cannot find anywhere to add it to the soap header.
  As a reference, this is the code i run inside my main method:</p>
  
  <pre><code>Api.Servicereference1.PortClient object = new Api.Servicereference1.PortClient();                        
  object.testmethod();
  </code></pre>
  
  <p>The output from this piece is the following:</p>
  
  <pre><code>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&gt;
      &lt;s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
          &lt;testmethod xmlns="http://wsdlserver.com/soap"/&gt;
      &lt;/s:Body&gt;
  &lt;/s:Envelope&gt;
  </code></pre>
  
  <p>However, what i want to achive is the following message sent, with the authentication:</p>
  
  <pre><code>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&gt;
      &lt;s:Header&gt;
          &lt;s:auth&gt;key&lt;/s:auth&gt;
      &lt;/s:Header&gt;
      &lt;s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;        
          &lt;testmethod xmlns="http://wsdlserver.com/soap"/&gt;
      &lt;/s:Body&gt;
  &lt;/s:Envelope&gt;
  </code></pre>
  
  <p>Can anyone help me in the right direction, as to how I can add this custom header to my messages?
  Thanks.</p>