当它处理需要很长时间的大量数据时,我遇到了问题AIF
。AX 2012
我正在使用适配器NetTCP
,并且在使用 WebForm 应用程序使用 Web 服务时遇到以下异常。
The open operation did not complete within the allotted timeout of 00:01:00.
The time allotted to this operation may have been a portion of a longer timeout.
InnerException:The socket transfer timed out after 00:00:59.9990234. You have exceeded the timeout set on your binding.
The time allotted to this operation may have been a portion of a longer timeout.
InnerException:A connection attempt failed because the connected party did not properly respond after a period of time,
or established connection failed because connected host has failed to respond
应用程序代码基本上是(我什至在每个循环中打开和关闭连接),如主题错误消息:打开操作未在分配的超时内完成:
public void CreateFromCSVFile(Stream fileStream)
{
ExportingData_Test.VendVendServices.VendTableServiceClient VenSvcClient = new VendTableServiceClient();
try
{
List<string[]> VendData = Helper.ImportCSVFile.ParseCSVFile(fileStream, true);
foreach (string[] vendor in VendData)
{
VenSvcClient = new VendTableServiceClient();
VenSvcClient.Endpoint.Binding.OpenTimeout = new TimeSpan(0, 1, 10, 0);
VenSvcClient.Endpoint.Binding.ReceiveTimeout = new TimeSpan(0, 1, 10, 0);
VenSvcClient.Endpoint.Binding.SendTimeout = new TimeSpan(0, 1, 10, 0);
VenSvcClient.Endpoint.Binding.CloseTimeout = new TimeSpan(0, 1, 10, 0);
VenSvcClient.Open();
//DO SOME OPERATION IN HERE
//Create the Vendor
entityKey = VenSvcClient.create(callContext, axdVendor);
VenSvcClient.Close();
}
}
catch (Exception ex)
{
String message = ex.Message;
}
finally
{
VenSvcClient.Close();
}
}
我尝试使用Microsoft Service Configuration Editor配置增强端口,用于配置下面的 WCF,增加了大多数属性:
在主机中:
- 关闭超时到 00:10:00
- OpenTimeout 到 00:10:00
在绑定中:
- MaxReceivedMessageSize 为 1004857600。在这里建议。
- MaxBufferSize 为 1004857600。
- MaxBufferPoolSize 为 1004857600。
- ReceivedTimeout 01:10:00
- 发送超时 01:10:00
- MaxBytesPerRead 1004857600
- 不活动超时 01:10:00
- 可靠会话属性 false
但我仍然遇到同样的错误。