title: Jquery AJAX Post: 500 (Internal Server Error)?
body: <p>I am trying post a string to web service but I am getting this error (Google Chrome Extension Project): </p>
  
  <blockquote>
    <p>jquery-2.1.1.min.js:4 POST <a href="http://localhost:49242/Service.asmx/test" rel="nofollow">http://localhost:49242/Service.asmx/test</a>
    500 (Internal Server Error)</p>
  </blockquote>
  
  <p>Here is my ajax code:</p>
  
  <pre><code>var data = {};
  data.param1 = words[0];
  
  $.ajax({
      data: JSON.stringify({ 'data': data.param1 }),
      dataType: 'application/json',
      url: 'http://localhost:49242/Service.asmx/test',
      type: 'POST',
      contentType: 'application/json; charset=utf-8',
      success: function (result) {
          alert(result);
      },
      failure: function (errMsg) {
          alert(errMsg);
      }
  });
  </code></pre>
  
  <p>My service:</p>
  
  <pre><code>[WebMethod]
  
  [System.Web.Script.Services.ScriptMethod(ResponseFormat = System.Web.Script.Services.ResponseFormat.Json)]
  public string test(string param1) {
      return param1;
  }
  </code></pre>
  
  <p>I am working on this problem about 3 days. Can you help me ? </p>
  
  <p>By the way, I have a question. I am posting json variable to service with ajax(like you see), but service returning xml value. Is there a problem or <code>[System.Web.Script.Services.ScriptMethod(ResponseFormat = System.Web.Script.Services.ResponseFormat.Json)]</code> this code block solving problem?</p>