title: Object reference not set to an instance of an object in Webservice
body: <p>In my Project I am having a WebService for generating a list, when I run the WebService I get the <code>NullReference Exception</code> in the <code>c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Config\DefaultWsdlHelpGenerator.aspx</code>.</p>
  
  <p>Could anybody point me what is the problem in my code?</p>
  
  <p>The Code I tried is:</p>
  
  <pre><code>  using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.Services;
    using System.Data.SqlClient;
    using System.Data;
    using SubSonic;
  
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    [System.Web.Script.Services.ScriptService]
  public class AutoComplete : System.Web.Services.WebService
  {
  public AutoComplete()
  {
      //InitializeComponent(); 
  }
  
   public string[] Getlist(string keywordstartswith)
     {
      IList&lt;string&gt; output = new List&lt;string&gt;();
      Dictionary&lt;string, string&gt; mydict = new Dictionary&lt;string, string&gt;();
      string QueryString = System.Configuration.ConfigurationManager.ConnectionStrings   ["IUMSNXG"].ToString();
      IDataReader obj_result = SearchApp.DBCon.LRS_SP_CBFM_Sel(keywordstartswith).GetReader();
      DataTable dt = new DataTable();
      dt.Load(obj_result);
      if(dt.Rows.Count &gt; 0)
      {
           while (obj_result.Read())
           {
              output.Add(string.Format("{0}~{1}", obj_result["AnimalCode"].ToString().TrimEnd(), obj_result["pk_animalid"].ToString().TrimEnd()));
           } 
      }
      return output.ToArray();
    }
   }
  </code></pre>
  
  <p>The Source Error I am Getting is:</p>
  
  <pre><code>Line 1333:
  Line 1334:    OperationBinding FindHttpBinding(string verb) {
  Line 1335:        foreach (ServiceDescription description in serviceDescriptions) // Getting Error Here
                     {
  Line 1336:            foreach (Binding binding in description.Bindings) {
  Line 1337:                HttpBinding httpBinding = (HttpBinding)binding.Extensions.Find(typeof(HttpBinding));
  </code></pre>
  
  <p>The Stack Trace is</p>
  
  <pre><code>[NullReferenceException: Object reference not set to an instance of an object.]
     ASP.defaultwsdlhelpgenerator_aspx.FindHttpBinding(String verb) in c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Config\DefaultWsdlHelpGenerator.aspx:1335
     ASP.defaultwsdlhelpgenerator_aspx.get_HttpPostOperationBinding() in c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Config\DefaultWsdlHelpGenerator.aspx:526
     ASP.defaultwsdlhelpgenerator_aspx.get_ShowingHttpPost() in c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Config\DefaultWsdlHelpGenerator.aspx:541
     ASP.defaultwsdlhelpgenerator_aspx.__Render__control20(HtmlTextWriter __w, Control parameterContainer) in c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319 \Config\DefaultWsdlHelpGenerator.aspx:1574
    System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +109
    System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
    System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +31
    System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
    System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
    System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
    System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +208
    System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
    System.Web.UI.Page.Render(HtmlTextWriter writer) +29
    System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
    System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
    System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3060
  </code></pre>