Q: 500 (Internal Server Error) while calling webservice from jquery for autosuggest When i am trying to access the webservice for autosuggest from the script, i am getting an internal server (500) error.
ERRoR :POST localhost:4202/Presentation/AutoCompleteService.asmx/GetAutoCompleteData 500 (Internal Server Error) jquery.min.js:130
Kindly help
**JQUERY** which is used for calling the service
jQuery(function () {
                $(".autosuggest").autocomplete({
                    source: function (request, response) {
                        $.ajax({
                            type: "POST",
                            contentType: "application/json; charset=utf-8",
                            url: "AutoCompleteService.asmx/GetAutoCompleteData",
                            data:"{'stationname':'" + document.getElementById('MasterContent_srctxtbx').value + "'}",
                            dataType: "json",
                            dataFilter: function (data) { return data; },
                            success: function (data) {
                                response(data.d);
                            },
                            error: function (XMLHttpRequest, result, errorThrown) {
                                alert(errorThrown);
                            } 
                        });
                    } 
                });

            });


 <td>
                        <asp:TextBox ID="srctxtbx" class="autosuggest" runat="server"></asp:TextBox>
                    </td>




[System.Web.Script.Services.ScriptService]
        public class AutoCompleteService : System.Web.Services.WebService
        {
            [WebMethod]
            public List<string> GetAutoCompleteData(string stationname)
            {
                List<string> result = new List<string>();
                DataTable traindetails = dataaccess.GetTrainDetailsForautosugget(stationname);
                for (int i = 0; i < traindetails.Rows.Count; i++)
                {

                    result.Add(traindetails.Rows[i]["Source"].ToString());

                }

                return result;
            }
        }


A: sorry I'm late, but I have just been having the same problem and I have just solved it as follows.  Hope this helps.
At the top of your .asmx code (C# presumably) try putting the following line, right above the public class declaration.  This is needed to allow it to be callable from AJAX.
    [System.Web.Script.Services.ScriptService]

