我通过Web API 保存采购订单时报如下错误,麻烦大神帮忙看看是什么原因引起的,要怎么解决,谢谢!
程序运行遇到了未知的错误:
错误提示:{ctx == null}
错误堆栈: at Kingdee.BOS.ServiceFacade.KDServiceFx.ServiceExecutor.Execute(KDServiceContext context, ServiceType svcType, String[] paraValues, SerializerProxy serializeProxy, ServiceType beginMethod)
at Kingdee.BOS.ServiceFacade.KDServiceFx.ExecuteServiceModule.OnProcess(KDServiceContext context)
at Kingdee.BOS.ServiceFacade.KDServiceFx.ModulePipeline.ExcuteRequest(KDServiceContext context)
at Kingdee.BOS.ServiceFacade.KDServiceFx.RequestExcuteRuntime.BeginRquest(RequestExtractor requestExtractor, WebContext webCtx)
at Kingdee.BOS.ServiceFacade.KDServiceFx.RequestExcuteRuntime.StartRequest(RequestExtractor requestExtractor, WebContext context)
at Kingdee.BOS.ServiceFacade.KDServiceFx.KDSVCHandler.ExecuteRequest(WebContext ctx, RequestExtractor requestExtractor)
at Kingdee.BOS.ServiceFacade.KDServiceFx.KDSVCHandler.ProcessRequestInternal(WebContext webCtx, RequestExtractor requestExtractor)
调用方式如下:
// 调用Web API接口服务,保存采购订单
ApiClient client = new ApiClient(KDParam.WebSite);
result = client.Execute
"Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Save",
new object[] { "PUR_PurchaseOrder", jsonRoot });
jsonRoot 字符串格式及内容如下:
{
"Creator": "三方调用者标识",
"NeedUpDateFields": [
"FBillTypeID",
"FBillNo",
"FDate",
"FProviderAddress",
"FBusinessType",
"F_dev_SrcBillNo",
"FPurchaseOrgId",
"FPurchaseDeptId",
"FPurchaserId",
"FSupplierId",
"PUR_PurchaseOrder__FPOOrderFinance",
"FExchangeTypeId",
"FExchangeRate",
"FSettleCurrId",
"FPayConditionId",
"FSettleModeId",
"PUR_PurchaseOrder__FIinstallment",
"FYFDATE",
"FYFRATIO",
"FinsPayAdvanceRate",
"FISPREPAYMENT",
"FInsPayAdvanceAmount",
"FACTUALAMOUNT",
"FYFAMOUNT",
"PUR_PurchaseOrder__FPOOrderEntry",
"FMaterialId",
"FUnitID",
"FQty",
"FStockQty",
"FPriceUnitQty",
"FBaseUnitQty",
"FDeliveryMaxQty",
"FBaseDeliveryMaxQty",
"FBASESTOCKRETQTY",
"FSTOCKRETQTY",
"FRequireOrgId",
"FReceiveOrgId",
"FEntrySettleOrgId",
"FTaxPrice",
"FPrice",
"FEntryTaxAmount",
"FEntryTaxRate",
"FEntryAmount",
"FAllAmount"
],
"Model": {
"FID": 0,
"FBillTypeID": {
"FNumber": "CGDD01_SYS"
},
"FProviderAddress": "JHD-2011-01-17-73",
"FBusinessType": "CG",
"F_dev_SrcBillNo": "JHD-2011-01-17-73",
"FDate": "2017-01-01 11:52:01",
"FPurchaseOrgId": {
"FNumber": "100"
},
"FPurchaseDeptId": {
"FNumber": "Joby-时尚装饰类"
},
"FPurchaserId": {
"FNumber": "何燕婷"
},
"FSupplierId": {
"FNumber": "270"
},
"PUR_PurchaseOrder__FPOOrderFinance": [
{
"FExchangeTypeId": {
"FNumber": "HLTX01_SYS"
},
"FExchangeRate": 6.7862,
"FSettleCurrId": {
"FNumber": "PRE001"
},
"FPayConditionId": {
"FNumber": ""
},
"FSettleModeId": {
"FNumber": ""
}
}
],
"PUR_PurchaseOrder__FIinstallment": [
{
"FYFDATE": "2011-01-17 10:36:00",
"FYFRATIO": 0,
"FinsPayAdvanceRate": 0,
"FISPREPAYMENT": false,
"FInsPayAdvanceAmount": "0.00",
"FYFAMOUNT": "70.000000"
}
],
"PUR_PurchaseOrder__FPOOrderEntry": [
{
"FMaterialId": {
"FNumber": "P338X001"
},
"FUnitID": {
"FNumber": "条"
},
"FQty": "10.00",
"FStockQty": "10.00",
"FPriceUnitQty": "10.00",
"FBaseUnitQty": "10.00",
"FDeliveryMaxQty": "10.00",
"FBaseDeliveryMaxQty": "10.00",
"FBASESTOCKRETQTY": "10.00",
"FSTOCKRETQTY": "10.00",
"FRequireOrgId": {
"FNumber": 100
},
"FReceiveOrgId": {
"FNumber": 100
},
"FEntrySettleOrgId": {
"FNumber": 100
},
"FTaxPrice": "7.000000",
"FPrice": "7.000000",
"FEntryTaxAmount": 0,
"FEntryTaxRate": 0,
"FEntryAmount": "70.000000",
"FAllAmount": "70.000000"
}
]
}
}
推荐阅读