title: "Message" : "Invalid web service call, missing value for parameter: \u0027
body: <p>I got this error when i send a parameter from jQuery to WebMethod</p>
  
  <p><em>{"Message":"Invalid web service call, missing value for parameter:      \u0027personelName\u0027.","StackTrace":"   at           System.Web.Script.Services.WebServiceMethodData.CallMethod(Object target, IDictionary<code>2 parameters)\r\n   at    System.Web.Script.Services.WebServiceMethodData.CallMethodFromRawParams(Object target, IDictionary</code>2 parameters)\r\n   at System.Web.Script.Services.RestHandler.InvokeMethod(HttpContext context, WebServiceMethodData methodData, IDictionary`2 rawParams)\r\n   at System.Web.Script.Services.RestHandler.ExecuteWebServiceCall(HttpContext context, WebServiceMethodData methodData)","ExceptionType":"System.InvalidOperationException"}</em></p>
  
  <p>My aspx page</p>
  
  <pre><code> &lt;%@ Page Language="C#" AutoEventWireup="true"                  CodeBehind="denemeAutoComp.aspx.cs" Inherits="AutoCompleteDeneme.denemeAutoComp"        %&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head id="Head1" runat="server"&gt;
  &lt;title&gt;&lt;/title&gt;
  &lt;link href="Style/jquery-ui-1.10.4.custom.min.css" rel="stylesheet"   type="text/css" /&gt;
  &lt;script src="Script/jquery-1.10.2.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="Script/jquery-ui-1.10.4.custom.min.js" type="text/javascript"&gt;    
  &lt;script type="text/javascript"&gt;
  
      $(document).ready(function () {
          $('#txtPersonelName').autocomplete({
  
              source: function (request, response) {
  
                  $.ajax({
  
                     url: '&lt;%=ResolveUrl("~/PersonelService.asmx/GetPersonelNames") %&gt;',
                      data: "{ 'searchTerm': '" + request.term + "' }",
                       type: "POST",
                       dataType: "json",
                      contentType: "application/json; charset=utf-8",
                      success: function (result) {
                          response(result.d);
                      },
  
                      error: function (result) {
                          alert('there is a problem processing your request');
                          alert(result.responseText);
                      }
                  });
              }
  
  
  
  
          });
      });
  
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form id="form1" runat="server"&gt;
      &lt;div style="font-family: Arial" class="divAuto"&gt;
          Name:
      &lt;asp:TextBox ID="txtPersonelName" runat="server"&gt;&lt;/asp:TextBox&gt;
          &lt;asp:Button ID="btnSubmit" runat="server" Text="Submit" /&gt;
          &lt;br /&gt;
          &lt;asp:GridView ID="gvPersonels" runat="server"&gt;
          &lt;/asp:GridView&gt;
  
  
      &lt;/div&gt;
  
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>My Web Service(PersonelService.asmx)</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.Services;
  using System.Data;
  using System.Data.SqlClient;
  using System.Configuration;
  using System.Web.Script.Services;
  
  namespace AutoCompleteDeneme
  {
  
  [WebService(Namespace = "http://tempuri.org/")]
  [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
  [System.ComponentModel.ToolboxItem(false)]
  // To allow this Web Service to be called from script, using ASP.NET AJAX,      uncomment the following line. 
  [System.Web.Script.Services.ScriptService]
  public class PersonelService : System.Web.Services.WebService
  {
  
      [WebMethod]
      public List&lt;string&gt; GetPersonelNames(string personelName)
      {
  
          string CS =   ConfigurationManager.ConnectionStrings["MyConnectionString"].ConnectionString;
          List&lt;string&gt; personelNames = new List&lt;string&gt;();
          using (SqlConnection con = new SqlConnection(CS))
          {
              SqlCommand cmd = new SqlCommand("spGetMatchingPersonelNames", con);
              cmd.CommandType = CommandType.StoredProcedure;
  
              SqlParameter parameter = new SqlParameter("@PersonelName", personelName);
              cmd.Parameters.Add(parameter);
              con.Open();
              SqlDataReader rdr = cmd.ExecuteReader();
              while (rdr.Read())
              {
                  personelNames.Add(rdr["adi"].ToString());
  
              }
          }
          return personelNames;
  
  
      }
  }
  }
  </code></pre>