如何在 acumatica 中使用 webservices api 导出数据时设置超时

how to set the timeout while exporting data using webservices api in acumatica

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

我在导出应用程序选项卡菜单中的所有记录时总是出错。并且错误消息是 "Operation Timeout".

在通过网络服务导出大量文档的过程中是否有设置超时的参考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()}

Here is the link to WebClientProtocol.Timeout property on MSDN - 最好查看 MSDN,因为超时 属性 源自 .Net 框架 类 中的一个基

方法是更改​​ Screen 对象的超时值。 在您的情况下,我认为该对象是 "context".

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

操作方法如下:

context.Timeout = 700000;