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 C++ yoloV5改写遇到的问题
    • ¥20 win11修改中文用户名路径
    • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
    • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
    • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
    • ¥15 帮我写一个c++工程
    • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
    • ¥15 关于smbclient 库的使用
    • ¥15 微信小程序协议怎么写
    • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?