非常に古い 1.1 vb.net / asp.net Web アプリ。私はこれでオートコンプリートテキストボックスを埋めるためにajax呼び出しをしようとしています:
    $("#ucAddActionItemIssueActions_txtActionItem")
// don't navigate away from the field on tab when selecting an item
.bind("keydown", function(event) {
    if (event.keyCode === $.ui.keyCode.TAB && $(this).data("autocomplete").menu.active) {
        event.preventDefault();
    }
}).autocomplete({
    minLength: 0,
   source: function (request, response) {
        //get client value
        var c = $("#ucAddActionItemIssueActions_ddlClientAssignTo").val();
         var params= '{"ClientID":' + c + '}';
        $.ajax({
            url: "GetLogins.asmx/GetLogins",
            data: params,
            dataType: "json",
            type: "POST",
            contentType: "application/json; charset=utf-8",
            dataFilter: function (data) { return data; },
            success: function (data) {
                response($.map(data.d, function (item) {
                    return {
                        value: item.name
                    }
                }))
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                alert(textStatus);
            }
        });},
    focus: function() {
        // prevent value inserted on focus
        return false;
    },
    select: function(event, ui) {
        var terms = split(this.value);
        // remove the current input
        terms.pop();
        // add the selected item
        terms.push(ui.item.value);
        var email = GetEmail(ui.item.value);
        email = email + ";";
        emails.push(email);
        $("#ucAddActionItemIssueActions_hdnEmails").val(emails.join(""));
        // add placeholder to get the comma-and-space at the end
        terms.push("");
        this.value = terms.join("");
        return false;
    }
});
Web メソッド (.asmx ファイル) は次のとおりです (テスト ケースとして)。
Imports System.Web.Services
Imports System.Collections
<System.Web.Services.WebService(Namespace := "http://tempuri.org/quikfix.jakah.com/GetLogins")> _
Public Class GetLogins
    Inherits System.Web.Services.WebService
    <WebMethod()> _
    Public Function GetLogins(ByVal ClientID As Integer) As String()
        Dim myList As New ArrayList
        myList.Add("jstevens")
        myList.Add("jdoe")
        myList.Add("smartin")
        Dim arr() As String = CType(myList.ToArray(Type.GetType("System.String")), String())
        Return arr
    End Function
End Class
Chrome の開発者ツールでアプリを実行すると、内部 500 エラーがスローされます。それをクリックすると、次のように表示されます。
System.InvalidOperationException: リクエストの形式が無効です: application/json; 文字セット=UTF-8。System.Web.Services.Protocols.HttpServerProtocol.ReadParameters() で System.Web.Services.Protocols.WebServiceHandler.Invoke() で System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest() で
パラメータはすべて一致するため、これがエラーをスローする理由がわかりません。web.config.asmx ファイルへの参照を明示的に指定するために、ファイルに何かが必要ですか? これは古い 1.1 .net Web アプリなので、web.config ファイルを変更する必要があるかどうかわかりません。