title: Object reference not set to an instance of an object.??? in soap?
body: <p>Got an error while trying to invoke the webservice</p>
  
  <p>"System.NullReferenceException: Object reference not set to an instance of an object."
  Error on this line</p>
  
  <pre><code>if (Authentication.Username == "x" &amp;&amp;
              Authentication.Password == "y")
  </code></pre>
  
  <p><strong>what does this mean?</strong></p>
  
  <hr>
  
  <pre><code>[WebService(Namespace = "https://domain.com")]
  [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
  [System.ComponentModel.ToolboxItem(false)]
  public class Testing : System.Web.Services.WebService
  {
      public TestAuthHeader Authentication;
      public class TestAuthHeader : SoapHeader
      {
          public string Username;
          public string Password;
      }
  
      [WebMethod]
      [SoapHeader("Authentication")]
      public string TestService()
      {
          if (Authentication.Username == "x" &amp;&amp;
              Authentication.Password == "y")
          {
              return "OK";
          }
          else
          {
              return "Access Denided";
          }
      }
  }
  </code></pre>