The open operation did not complete within the allotted timeout of 00:01:00 - AX 2012 using AIF/WCF

Tito picture Tito · Aug 1, 2012 · Viewed 11.5k times · Source

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:

  1. CloseTimeout to 00:10:00
  2. OpenTimeout to 00:10:00

In Bindings:

  1. MaxReceivedMessageSize to 1004857600. like in here advised.
  2. MaxBufferSize to 1004857600.
  3. MaxBufferPoolSize to 1004857600.
  4. ReceivedTimeout 01:10:00
  5. SendTimeout 01:10:00
  6. MaxBytesPerRead 1004857600
  7. InactivityTimeout 01:10:00
  8. ReliableSessionProperty false

But I am still getting the same error.

Answer

Jan B. Kjeldsen picture Jan B. Kjeldsen · Aug 17, 2012

The same error is mentioned here.

But the advice is to edit the parameters ReceiveTimeout and SendTimeout using Microsoft WCF Service Configuration Editor, which you may have done. Maybe double check that you hit the correct ports.