WCF返回400?

时间:2013-11-01 16:29:05

标签: c# ajax wcf

我正在尝试创建一个WCF服务,但是我收到了以下错误,我在调用Ajax时从fiddler那里得到了这个错误。

The server encountered an error processing the request. The exception message is 'Error in deserializing body of request message for operation 'GetRecords'. OperationFormatter encountered an invalid Message body. Expected to find an attribute with name 'type' and value 'object'. Found value 'boolean'.'. See server logs for more details. The exception stack trace is:

有人可以解释错误,原因可能是因为我不确定这里会出现什么问题。

我正在使用POST发送ajax请求。这是我的ajax请求:

var url = "webservices/mainGrid/Nick.svc/GetRecords"
var source = {
    dataType: 'json',
    url: url,
    type: "POST",
    id: "SEQUENCE",
    root: 'rowsinfo',
    contentType: "application/json; charset=utf-8",
    async: false,
    cache: false,
    columns:[],
    datafields:[],
    beforeprocessing: function (data) {
        var columnsdata = new Array();
        var datafieldsdata = new Array();
        for (k in data.columnsinfo){
            var col={};
            col.text = data.columnsinfo[k]["DISPLAYNAME"];
            col.datafield = data.columnsinfo[k]["DISPLAYNAME"];
            var datafields={};
            datafields.name = data.columnsinfo[k]["DISPLAYNAME"];
            columnsdata .push(col);
            datafieldsdata  .push(datafields);
            source.columns = columnsdata;
            source.datafields = datafieldsdata;
        }
        $("#jqxgrid").jqxGrid({columns : source.columns});
    },
        data: {
            group: JSON.stringify(checkedGroups),
            staff: JSON.stringify(checkedStaff),
            MODULE: selectedModuleSEQ
            }
    };

有关错误的任何信息都会很好!感谢

0 个答案:

没有答案