如何通过Web Api新增退料单据?
金蝶云社区-云社区用户22yY3288
云社区用户22yY3288
0人赞赏了该文章 2,419次浏览 未经作者许可,禁止转载编辑于2015年02月26日 13:08:11

下面是调用接口的参考代码,但请求参数太多了,构建起来很麻烦!试半天都不能新增单据成功,求指点!

// 使用webapi引用组件Kingdee.BOS.WebApi.Client.dll
ApiClient client = new ApiClient("http://pc-20130620ogwx/K3Cloud/K3Cloud/");
object[] loginInfo = new object [] {
"54a8fc8ba1e8cb",//帐套Id
"Administrator",//用户名
"888888",//密码
2052}//语言id
var ret = client.Execute("Kingdee.BOS.WebApi.ServicesStub.AuthService.ValidateUser",loginInfo);
var result = JObject.Parse(ret)["LoginResultType"].Value();
// 登陆成功
if (result == 1)
{
client.Execute("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Save",new object [] {"PRD_ReturnMtrl","{\"Creator\":\"String\",\"NeedUpDateFields\":[\"String\"],\"Model\":{\"FID\":0,\"FBillNo\":\"String\",\"FBillType\":{\"FBILLTYPEID\":\"String\",\"FNumber\":\"String\",\"FName\":\"String\"},\"FDate\":\"\/Date(-62135596800000+0800)\/\",\"FDocumentStatus\":\"String\",\"FStockOrgId\":{\"FOrgID\":0,\"FNUMBER\":\"String\",\"FNAME\":\"String\"},\"FTransferBizType\":{\"FID\":0,\"FNumber\":\"String\",\"FName\":\"String\"},\"FStockId0\":{\"FStockId\":0,\"FNumber\":\"String\",\"FName\":\"String\",\"FStockStatusType\":\"String\"},\"FPrdOrgId\":{\"FOrgID\":0,\"FNUMBER\":\"String\",\"FNAME\":\"String\"},\"FWorkShopId\":{\"FDEPTID\":0,\"FNumber\":\"String\",\"FName\":\"String\"},\"FOwnerTypeId0\":\"String\",\"FOwnerId0\":{\"FItemID\":0,\"FNumber\":\"String\",\"FName\":\"String\"},\"FReturnerId\":{\"FSTAFFID\":0,\"FStaffNumber\":\"String\",\"FName\":\"String\"},\"FSTOCKERID\":{\"FID\":0,\"FNumber\":\"String\",\"FName\":\"String\",\"FISUSE\":false},\"FDescription\":\"String\",\"FCreatorId\":{\"FUserID\":0,\"FUserAccount\":\"String\",\"FName\":\"String\"},\"FCreateDate\":\"\/Date(-62135596800000+0800)\/\",\"FModifyDate\":\"\/Date(-62135596800000+0800)\/\",\"FApproverId\":{\"FUserID\":0,\"FUserAccount\":\"String\",\"FName\":\"String\"},\"FModifierId\":{\"FUserID\":0,\"FUserAccount\":\"String\",\"FName\":\"String\"},\"FApproveDate\":\"\/Date(-62135596800000+0800)\/\",\"FCanceler\":{\"FUserID\":0,\"FUserAccount\":\"String\",\"FName\":\"String\"},\"FCancelDate\":\"\/Date(-62135596800000+0800)\/\",\"FCancelStatus\":\"String\",\"FCurrId\":{\"FCURRENCYID\":0,\"FNumber\":\"String\",\"FName\":\"String\",\"FSYSMBOL\":\"String\",\"FPRICEDIGITS\":0,\"FAMOUNTDIGITS\":0,\"FIsShowCSymbol\":false,\"FFormatOrder\":\"String\"},\"FIsCrossTrade\":false,\"FVmiBusiness\":false}}"};
}