销售订单WebAPI-提示"分录实体“订单明细”是必填项"
金蝶云社区-133xxxx4638
133xxxx4638
0人赞赏了该文章 2,365次浏览 未经作者许可,禁止转载编辑于2016年06月08日 17:59:04


[tr][td]代码如下:
try
{
//管理中心站点
ApiClient client = new ApiClient(WebAPIConfig.CloudUrl);
//调用登录接口,参数,数据中心ID,用户名,密码,语言id
bool ret = client.Login(WebAPIConfig.DbId, WebAPIConfig.UserName, WebAPIConfig.PassWord, WebAPIConfig.Lcid);
//登录成功
if (ret)
{
string strJson = JsonConvert.SerializeObject(saveModel);
object[] subInfo = new object[]
{
sFormId,
strJson
};
var strRet = client.Execute("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Save", subInfo);
WriteLog.WriteLogAndTime("WebAPI Msg" + strRet);
RetObject retObject = JsonConvert.DeserializeObject(strRet);
if (!retObject.Result.ResponseStatus.IsSuccess)
{
throw new Exception("接口错误!");
}
}
}
catch (Exception ex)
{
WriteLog.WriteLogAndTime("WebAPI接口错误" + ex.Message);
throw new Exception("接口错误" + ex.Message);
}

请求Json串
{"Creator":"Demo","NeedUpDateFields":[""],"Model":{"FID":0,"FBUSINESSTYPE":"NORMAL","FDate":"2016-06-08 17:40:58.278","FBillTypeID":{"FNumber":"XSDD01_SYS"},"FSaleOrgId":{"FNumber":"103"},"FsaleDeptID":{"FNumber":"BM000001"},"FcustID":{"FNumber":"CUST0001"},"FSalerId":{"FNumber":"20140822"},"FSaleOrderFinance":{"FExchangeRate":1},"FSaleOrderEntry":[{"FID":0,"FMaterialID":{"FNUMBER":"1.01.0012222"},"FQty":3.5,"FBASEUNITQTY":3.5,"FTaxPrice":100.0,"FPriceUnitQty":3.5,"FDELIVERYDATE":"2016-06-09 17:40:58.278"},{"FID":0,"FMaterialID":{"FNUMBER":"1.01.0012222"},"FQty":9.0,"FBASEUNITQTY":9.0,"FTaxPrice":200.0,"FPriceUnitQty":9.0,"FDELIVERYDATE":"2016-06-09 17:40:58.278"}]}}

返回Json串
{"Result":{"ResponseStatus":{"ErrorCode":500,"IsSuccess":false,"Errors":[{"FieldName":"FSaleOrderEntry","Message":"分录实体“订单明细”是必填项","DIndex":0}],"SuccessEntitys":[]},"Id":""}}

在这请求Json串里边包含FSaleOrderEntry订单明细),为什么还这样提示,这是哪里不对哦?