如何在Acumatica中使用WebServices API导出数据时设置超时 [英] how to set the timeout while exporting data using webservices api in acumatica

查看:85
本文介绍了如何在Acumatica中使用WebServices API导出数据时设置超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是第一种情况:
-我在acumatica系统中使用webservices api到Bill and Adjustments屏幕(AP301000)创建新的 bill文档。
-之后,我还需要使用webservices将当前屏幕(AP301000)的应用程序选项卡菜单中的所有文档记录加载,以进行抵销过程。问题是要加载很多文档。它大约有9500个文档,当然还需要更多的时间才能进行(大约需要10分钟)。

This is the first scenario: - I create new "bill" document in acumatica system using webservices api to Bill and Adjustments screen (AP301000). - after that, I need to load all document records in Application tab menu of the current screen (AP301000) using webservices also for set off process. the problem is there are a lot of documents that will be loaded. It's about 9500 documents and of course need more times to proceed (it's about 10 minutes).

在 Aplication选项卡菜单中导出所有记录时,我总是会出错。并且错误消息是操作超时。

I always get an error in exporting process all records in this Aplication Tab menu. and the error message is "Operation Timeout".

是否有任何引用来设置通过webservices api导出大型文档时的超时。

Is there any reference to set the timeout in exporting process of a huge documents through the 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()}


推荐答案

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

Here is the link to WebClientProtocol.Timeout property on MSDN - it's way better to check MSDN since the Timeout property is derived from one of base classes in the .Net framework

将是更改屏幕对象的超时值。
在您的情况下,我认为对象是上下文。

The way to do it would be to change the Timeout value of the Screen object. In your case, I think that object is "context".

默认值为100000,单位是毫秒,因此是1分40秒。如果将这个值更改为700000(大约11分钟半),就可以了。

The default value is 100000 and this is in milliseconds, so 1 minute 40 seconds. If you were to change this value to 700000 which is around 11 minutes and a half, you should be fine.

此处是操作方法:

context.Timeout = 700000;

context.Timeout = 700000;

这篇关于如何在Acumatica中使用WebServices API导出数据时设置超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆