title: 500 Internal server error while trying to consume webmethod from jquery
body: <p>Ive got asmx handler file with cs class.</p>
  
  <p>When I enter mysite/myService.asmx?op=Test nice page is rendered and I can invoke my web method without any problems but when I try to do it from javascript I can see in firebug 500 error as a responce. I put breakpoint on the server side inside that web.method but it wasnt even invoked.</p>
  
  <p>what am I doing wrong ?</p>
  
  <p>Class Declaration:</p>
  
  <p>[System.Web.Script.Services.ScriptService]</p>
  
  <p>public partial class WebServiceDB : System.Web.Services.WebService {</p>
  
  <p>Web.Method:</p>
  
  <pre><code>[WebMethod]
  [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
  public string Test()
  {
      return "test";
  }
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>$.ajax({
                      url: "mysite/myService.asmx?op=Test",
                      type: "POST",
                      dataType: "json",
                      contentType: "application/json; charset=utf-8",
                      success: function (msg) {
                          alert("ok");
                      },
                      error: function (e) {
                          alert("error");
                      }
                  });
  </code></pre>
  
  <p>Thanks for help</p>