title: Consuming non-asmx SOAP 1.1 Web Service in C# with Header Security
body: <p>First time poster so please take it a bit easy on me if I break any posting rules - I have read them and I think I'm right.</p>
  
  <p>I've been searching for a while before posting and can't seem to find a guide on what I am trying to do so I thought I would post here.</p>
  
  <p>I need to write a C# .NET 3.5 program to consume a web service developed in Java. I have practice consuming ASMX web services in .NET using Web References from my experience writing Dynamics CRM plugins and software but this has me stumped.</p>
  
  <p>My first attempt was to use a Web Reference (yes, I know - not WCF) however the web service requires a PasswordDigest (SHA-1 with nonce and created), a username token and timestamp token in the SOAP header and I couldn't find a way to add these to the SOAP header using the Web Reference.</p>
  
  <p>My second attempt was to use a Service Reference (I believe, but I am probably wrong haha, that <em>this</em> is WCF) however I don't have much practice with this and any tutorials I found online were not much help.</p>
  
  <p>Each time when I try to use the WS, I get a rejection from the server for being unable to authenticate.</p>
  
  <p>My question is how do I consume a Web Service with these requirements in C# .NET 3.5?</p>
  
  <p>Thanks.</p>