如何在 Acumatica 中使用 Web 服务 API 导出数据时设置超时



这是第一种情况:- 我使用网络服务 API 在 acumatica 系统中创建新的"账单"文档到账单和调整屏幕 (AP301000(。- 之后,我需要使用网络服务在当前屏幕(AP301000(的应用程序选项卡菜单中加载所有文档记录,也用于启动过程。问题是有很多文档将被加载。大约有 9500 个文档,当然需要更多时间才能继续(大约 10 分钟(。

我总是在导出处理此应用程序选项卡菜单中的所有记录时遇到错误。 错误消息为"操作超时"。

是否有任何参考来设置通过 Web 服务 API 导出大型文档的过程的超时。

sCon.getLoginSettlementVoucher(context);
AP301000Content billSchema2 = context.AP301000GetSchema();
List<Command> cmds = new List<Command>();
billSchema2.DocumentSummary.Type.Commit = false;
billSchema2.DocumentSummary.Type.LinkedCommand = null;
var command2 = new Command[]
{
        new Value { Value = "Bill", LinkedCommand = billSchema2.DocumentSummary.Type},
        new Value { Value = "17000034", LinkedCommand = billSchema2.DocumentSummary.ReferenceNbr},
        billSchema2.Applications.DocTypeDisplayDocType,
        billSchema2.Applications.ReferenceNbrDisplayRefNbr,
        billSchema2.Applications.Balance,
        billSchema2.Applications.AmountPaid
 };
 try
 {
        var applications = context.AP301000Export(command2, null, 0, false, true); 
        ..........................
  }
  catch(Exception x){} finally{context.Logout()}

这是指向 MSDN 上的 WebClientProtocol.Timeout 属性的链接 - 最好检查 MSDN,因为 Timeout 属性派生自 .Net 框架中的基类之一

执行此操作的方法是更改屏幕对象的超时值。在你的情况下,我认为那个对象是"上下文"。

默认值为 100000,以毫秒为单位,即 1 分 40 秒。如果要将此值更改为 700000,即大约 11 分半钟,您应该没问题。

这是怎么做:

上下文。超时 = 700000;