关于webapi的使用
金蝶云社区-首次改名免费
首次改名免费
0人赞赏了该文章 2,698次浏览 未经作者许可,禁止转载编辑于2016年06月06日 16:57:57

请问一下webapi里面的保存单据,比如采购入库单,为什么只有单据头,没有单据体呢,如何同时新增单据头和单据体信息呢。
另外请问一下这个报错是什么意思。。看起来好像是json构造有问题,跟提供的实例一样的。。
===================================
HTTP/1.1 200 OK [Cache-Control: private, Content-Type: text/html; charset=utf-8, Server: Microsoft-IIS/7.5, X-AspNet-Version: 4.0.30319, Set-Cookie: kdservice-sessionid=9727a318-53f4-444f-a965-91d225fe295b; path=/, Set-Cookie: ASP.NET_SessionId=qzh5g1wggh1yyuwvnv0nitfd; path=/, X-Powered-By: ASP.NET, Date: Mon, 06 Jun 2016 08:54:19 GMT, Content-Length: 3392]------------------------------------response_error:{"InnerExWrapper":{"IsEmpty":false,"Data":{},"HelpLink":null,"Message":"Exception has been thrown by the target of an invocation.","Source":null,"StackTrace":" at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)\r\n at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)\r\n at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)\r\n at Kingdee.BOS.ServiceFacade.KDServiceFx.ServiceExecutor.Execute(KDServiceContext context, ServiceType svcType, String[] paraValues, SerializerProxy serializeProxy, ServiceType beginMethod)","TargetSite":null,"ExceptionType":"System.Reflection.TargetInvocationException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","InnerException":{"IsEmpty":false,"Data":{},"HelpLink":null,"Message":"Object reference not set to an instance of an object.","Source":null,"StackTrace":" at Kingdee.BOS.WebApi.FormService.BillOperationService.ExecuteOperation(FormOperation op, String data)\r\n at Kingdee.BOS.WebApi.FormService.WebApiServiceCall.ExcuteSpecialOperation(Context ctx, String formId, String data, Int64 opId)\r\n at Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Save(String formid, String data)","TargetSite":null,"ExceptionType":"System.Exception, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","InnerException":null}},"ClassName":"Kingdee.BOS.ServiceFacade.ServiceException","Message":"Object reference not set to an instance of an object.","Data":null,"InnerException":null,"HelpURL":null,"StackTraceString":" at Kingdee.BOS.ServiceFacade.KDServiceFx.ServiceExecutor.Execute(KDServiceContext context, ServiceType svcType, String[] paraValues, SerializerProxy serializeProxy, ServiceType beginMethod)\r\n at Kingdee.BOS.ServiceFacade.KDServiceFx.ExecuteServiceModule.OnProcess(KDServiceContext context)\r\n at Kingdee.BOS.ServiceFacade.KDServiceFx.ModulePipeline.ExcuteRequest(KDServiceContext context)\r\n at Kingdee.BOS.ServiceFacade.KDServiceFx.RequestExcuteRuntime.BeginRquest(RequestExtractor requestExtractor, WebContext webCtx)\r\n at Kingdee.BOS.ServiceFacade.KDServiceFx.RequestExcuteRuntime.StartRequest(RequestExtractor requestExtractor, WebContext context)\r\n at Kingdee.BOS.ServiceFacade.KDServiceFx.KDSVCHandler.ExecuteRequest(WebContext ctx, RequestExtractor requestExtractor)\r\n at Kingdee.BOS.ServiceFacade.KDServiceFx.KDSVCHandler.ProcessRequestInternal(WebContext webCtx, RequestExtractor requestExtractor)","RemoteStackTraceString":null,"RemoteStackIndex":0,"ExceptionMethod":"8\nExecute\nKingdee.BOS.ServiceFacade.KDServiceFx, Version=5.1.329.7, Culture=neutral, PublicKeyToken=null\nKingdee.BOS.ServiceFacade.KDServiceFx.ServiceExecutor\nSystem.String Execute(Kingdee.BOS.ServiceFacade.KDServiceFx.KDServiceContext, Kingdee.BOS.ServiceFacade.KDServiceFx.ServiceType, System.String[], Kingdee.BOS.ServiceFacade.SerializerProxy, Kingdee.BOS.ServiceFacade.KDServiceFx.ServiceType)","HResult":-2147467259,"Source":"Kingdee.BOS.ServiceFacade.KDServiceFx","WatsonBuckets":null,"_httpCode":500}
net.sf.json.JSONException: A JSONObject text must begin with '{' at character 1 of response_error:{"InnerExWrapper":{"IsEmpty":false,"Data":{},"HelpLink":null,"Message":"Exception has been thrown by the target of an invocation.","Source":null,"StackTrace":" at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)\r\n at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)\r\n at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)\r\n at Kingdee.BOS.ServiceFacade.KDServiceFx.ServiceExecutor.Execute(KDServiceContext context, ServiceType svcType, String[] paraValues, SerializerProxy serializeProxy, ServiceType beginMethod)","TargetSite":null,"ExceptionType":"System.Reflection.TargetInvocationException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","InnerException":{"IsEmpty":false,"Data":{},"HelpLink":null,"Message":"Object reference not set to an instance of an object.","Source":null,"StackTrace":" at Kingdee.BOS.WebApi.FormService.BillOperationService.ExecuteOperation(FormOperation op, String data)\r\n at Kingdee.BOS.WebApi.FormService.WebApiServiceCall.ExcuteSpecialOperation(Context ctx, String formId, String data, Int64 opId)\r\n at Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Save(String formid, String data)","TargetSite":null,"ExceptionType":"System.Exception, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","InnerException":null}},"ClassName":"Kingdee.BOS.ServiceFacade.ServiceException","Message":"Object reference not set to an instance of an object.","Data":null,"InnerException":null,"HelpURL":null,"StackTraceString":" at Kingdee.BOS.ServiceFacade.KDServiceFx.ServiceExecutor.Execute(KDServiceContext context, ServiceType svcType, String[] paraValues, SerializerProxy serializeProxy, ServiceType beginMethod)\r\n at Kingdee.BOS.ServiceFacade.KDServiceFx.ExecuteServiceModule.OnProcess(KDServiceContext context)\r\n at Kingdee.BOS.ServiceFacade.KDServiceFx.ModulePipeline.ExcuteRequest(KDServiceContext context)\r\n at Kingdee.BOS.ServiceFacade.KDServiceFx.RequestExcuteRuntime.BeginRquest(RequestExtractor requestExtractor, WebContext webCtx)\r\n at Kingdee.BOS.ServiceFacade.KDServiceFx.RequestExcuteRuntime.StartRequest(RequestExtractor requestExtractor, WebContext context)\r\n at Kingdee.BOS.ServiceFacade.KDServiceFx.KDSVCHandler.ExecuteRequest(WebContext ctx, RequestExtractor requestExtractor)\r\n at Kingdee.BOS.ServiceFacade.KDServiceFx.KDSVCHandler.ProcessRequestInternal(WebContext webCtx, RequestExtractor requestExtractor)","RemoteStackTraceString":null,"RemoteStackIndex":0,"ExceptionMethod":"8\nExecute\nKingdee.BOS.ServiceFacade.KDServiceFx, Version=5.1.329.7, Culture=neutral, PublicKeyToken=null\nKingdee.BOS.ServiceFacade.KDServiceFx.ServiceExecutor\nSystem.String Execute(Kingdee.BOS.ServiceFacade.KDServiceFx.KDServiceContext, Kingdee.BOS.ServiceFacade.KDServiceFx.ServiceType, System.String[], Kingdee.BOS.ServiceFacade.SerializerProxy, Kingdee.BOS.ServiceFacade.KDServiceFx.ServiceType)","HResult":-2147467259,"Source":"Kingdee.BOS.ServiceFacade.KDServiceFx","WatsonBuckets":null,"_httpCode":500}