長時間かかる大量のデータを扱う場合に問題が発生し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を構成するために使用され、ほとんどのプロパティを増やします。
ホストで:
- CloseTimeoutを00:10:00に
- OpenTimeoutを00:10:00に
バインディング:_
- MaxReceivedMessageSizeを1004857600に設定します。ここでのようにアドバイスします。
- MaxBufferSizeを1004857600に。
- MaxBufferPoolSizeを1004857600に。
- ReceivedTimeout 01:10:00
- SendTimeout 01:10:00
- MaxBytesPerRead 1004857600
- InactivityTimeout 01:10:00
- ReliableSessionProperty false
しかし、それでも同じエラーが発生します。