title: Calling asmx web service using JQuery with parameters causes 500 error
body: <p>I have a simple enough web service:</p>
  
  <pre><code>        [ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)]
          [WebMethod]
          public string GetToken(string a)
          {
          }
  </code></pre>
  
  <p>And I'm calling it client side using JQuery:</p>
  
  <pre><code>    $.ajax({
          post: 'GET',
          contentType: "application/json; charset=utf-8",
          dataType: 'json',
          url: '../url/GetToken',
          data: "{'a':'test'}",
          success: function (data) {
          },
          error: function (a, b, c) {
          }
      });
  </code></pre>
  
  <p>The call always fails and the error returned is 500 Internal Server Error. I have placed a breakpoint inside the web service, and the code isn't being reached at all. When I modify the web service to take no arguments at all (and remove the <code>data</code> element from the JQuery call) the call succeeds. I have played around with different ways to pass the <code>data</code> element; I've passed a JSON object (no quotes), and I've removed the quotes from around the <code>a</code> argument. None of it works.</p>
  
  <h2>Edit:</h2>
  
  <p>Using Fiddler I have determined that the actual error causing the 500 is "Invalid web service call, missing value for parameter".</p>
  
  <h2>Edit 2:</h2>
  
  <p>Passing data this way works:</p>
  
  <pre><code>data: "a='test'"
  </code></pre>
  
  <p>I have no idea why. Any ideas?</p>