title: Webservice throws 500 error from AJAX, but not when called directly
body: <p>I have an ASP.net application that's making a jQuery AJAX call to a VB.net webservice that lives <strong>in the same directory</strong>. On our test box, everything works beautifully. In production, if I go to the webservice's test form, I can retrieve data. The AJAX call, however, results in a 500 error. Here's the AJAX code:</p>
  
  <pre><code>$.ajax({
      type: "POST",
      url: "webservice.asmx/Action",
      data: "{'SearchString':'" + request.term + "'}",
      contentType: "application/json; charset=utf-8",
      dataType: "json",
      success: function (res) {
          alert("Success");            
      },
      error: function () {
      alert("Fail");
      }
  });
  </code></pre>
  
  <p>I've tried:</p>
  
  <ol>
  <li>Fiddling with the format of the data parameter in that call</li>
  <li>Setting the response format of the webservice ([ScriptMethod(ResponseFormat = ResponseFormat.Json)])</li>
  <li>Added this to the Web.Config:</li>
  </ol>
  
  <p>.</p>
  
  <pre><code>&lt;webServices&gt;
       &lt;protocols&gt;
           &lt;add name="HttpSoap" /&gt;
           &lt;add name="HttpGet" /&gt;
           &lt;add name="HttpPost" /&gt;
        &lt;/protocols&gt;
  &lt;/webServices&gt;
  </code></pre>
  
  <p>All has been for naught. This ONLY fails when being called from this function, and only on our production box. It works fine if I directly load the action from the .asmx page's form.</p>
  
  <p>My thought is that there must be a configuration difference between our test and production servers, but I can't find one that would be of any consequence. Besides, what kind of configuration would cause it to not work when being called one way, but not another, when the server handles them the same way?</p>
  
  <p>Has anyone encountered a similar problem that they've resolved?</p>