title: VB.NET ASMX returning the response header as XML instead of JSON
body: <p>My ASMX call is returning <code>Content-Type = text/xml; charset=utf-8</code>  </p>
  
  <p>I am using ASP.NET 3.5 and <code>jQuery.Ajax</code>.<br>
  Have added these things are per numerous suggestions from Stack Overflow</p>
  
  <p>I have done these things</p>
  
  <ol>
  <li><p>Done this at web.config</p>
  
  <pre><code>&lt;remove verb="*" path="*.asmx"/&gt;
  &lt;add verb="*" path="*.asmx" validate="false"
  type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
  </code></pre></li>
  <li><p>On the function call inside ASMX, I am using these</p>
  
  <pre><code>&lt;WebMethod()&gt; _
  &lt;ScriptMethod(ResponseFormat:=ResponseFormat.Json)&gt; _
  Public Function GetCompanies(SearchedCompany As String) As String
  </code></pre></li>
  <li><p>the jQuery Ajax call is like this</p>
  
  <pre><code>var searchString = "SearchedCompany=" + $(".auto-company").val();
  $.ajax({
      type: "POST",
      url: "Services/CompaniesService.asmx/GetCompanies",
      data: searchString,
      dataType: 'json',
      success: function (msg) {
          companies = msg.hasOwnProperty("d") ? msg.d : msg;
      },
      error: function (xhr, status, error) {
  
      }
  });
  </code></pre></li>
  </ol>
  
  <p>But whatever I do, the response header is still of type xml. What part am I missing here?</p>
  
  <p>Disclaimer: I know this has been asked many times around here. But was not able to find any answer. As you can see, I have already implemented all of the solutions provided.</p>