您好我在使用 Microsoft Dynamics NAV 2009 R2 Web 服务时遇到问题!
有一个名为OrderGoodsInsert的 webMethod需要参数lLanguageId [int], lRec [Text 250] [100]
lRec 应该是一个字符串数组,其值如下
- “文档类型”
- “文件号码。”
- “线号。” - (创建时为空)
- “插入用户”
- “修改用户”
- “类型”[0 – „”, 1 – 总账科目, 2 – 项目, 3 – 资源, 4 – 固定资产, 5 – 费用(项目)]
- “不。” - 项目代码
- 数量
使用 c# 代码,我尝试调用作为 Web 服务引用添加到我的项目的方法。编码:
string[] arr = new string[8];
arr[0] = "1";
arr[1] = currentDocNo;
arr[3] = "SU04";
arr[5] = "2";
arr[6] = item.Code;
arr[7] = item.Amount;
arr[2] = "";
arr[4] = "";
navWS.OrderGoodsInsert(1062, arr);
但是当我这样做时,我得到
A first chance exception of type 'System.Net.WebException'
occurred in System.dll
A first chance exception of type 'System.Web.Services.Protocols.SoapException'
occurred in System.Web.Services.dll
错误是index out of bounds
难道我做错了什么?