weixin_33747129 2013-11-01 16:29 采纳率: 0%
浏览 41

WCF返回400?

I am trying to create a WCF service but I am getting the following error which I have picked up from fiddler when making an Ajax call.

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:

Could someone explain the error and what could be the cause please as i'm not sure what could be going wrong here.

I am sending an ajax request using POST. Here is my ajax request:

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
            }
    };

Any information on the error would be good! thanks

  • 写回答

0条回答

    报告相同问题?

    悬赏问题

    • ¥15 #MATLAB仿真#车辆换道路径规划
    • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
    • ¥15 数据可视化Python
    • ¥15 要给毕业设计添加扫码登录的功能!!有偿
    • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
    • ¥15 微信公众号自制会员卡没有收款渠道啊
    • ¥100 Jenkins自动化部署—悬赏100元
    • ¥15 关于#python#的问题:求帮写python代码
    • ¥20 MATLAB画图图形出现上下震荡的线条
    • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘