【问题标题】:how to set the timeout while exporting data using webservices api in acumatica如何在 acumatica 中使用 webservices api 导出数据时设置超时
【发布时间】:2017-09-02 14:08:23
【问题描述】:

这是第一个场景: - 我在 acumatica 系统中使用 webservices api 到账单和调整屏幕 (AP301000) 创建新的“账单”文档。 - 之后,我需要使用 web 服务在当前屏幕 (AP301000) 的应用程序选项卡菜单中加载所有文档记录,以进行设置。问题是要加载很多文件。大约有 9500 个文档,当然需要更多时间来处理(大约 10 分钟)。

我在导出此应用程序选项卡菜单中的所有记录时总是出错。并且错误消息是“操作超时”。

有没有关于通过webservices 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()}

【问题讨论】:

    标签: c# web-services acumatica


    【解决方案1】:

    Here is the link to WebClientProtocol.Timeout property on MSDN - 最好检查 MSDN,因为 Timeout 属性派生自 .Net 框架中的基类之一

    这样做的方法是更改​​ Screen 对象的 Timeout 值。 在您的情况下,我认为该对象是“上下文”。

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

    这是怎么做的:

    context.Timeout = 700000;

    【讨论】:

      猜你喜欢
      • 2016-10-22
      • 2019-07-31
      • 1970-01-01
      • 1970-01-01
      • 2023-02-05
      • 2016-02-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多