I am having a problem with AIF
in AX 2012
when it deals with a big amount of data that takes a long time. I am using the adapter NetTCP
and I am having the following exception while consuming the web service using an WebForm application.
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
The application code is basically ( I am even opening and closing the connection in each loop), like in the topic Error message: The open operation did not complete within the allotted timeout:
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();
}
}
I tried to configurate the enhaced port using the Microsoft Service Configuration Editor, that is used to configure the WCF underneath, increasing most of the properties:
In Host:
- CloseTimeout to 00:10:00
- OpenTimeout to 00:10:00
In Bindings:
- MaxReceivedMessageSize to 1004857600. like in here advised.
- MaxBufferSize to 1004857600.
- MaxBufferPoolSize to 1004857600.
- ReceivedTimeout 01:10:00
- SendTimeout 01:10:00
- MaxBytesPerRead 1004857600
- InactivityTimeout 01:10:00
- ReliableSessionProperty false
But I am still getting the same error.