locked
Workflow consuming service: Timeout Exception RRS feed

  • Question

  • Hi,

    I have a workflow that is hosted in my development environment SharePoint site, and in an integration server.

    They both consume the same external WCF Service in our network. However, once in a while (1 out of 100 retry), the workflow in the integration server is unable to reach the service and I got this exception:

    System.TimeoutException: The request channel timed out while waiting for a reply after 00:01:00. Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted to this operation may have been a portion of a longer timeout. ---> System.TimeoutException: The HTTP request to 'https://linktoservice.com/.svc?wsdl' has exceeded the allotted timeout of 00:01:00. The time allotted to this operation may have been a portion of a longer timeout. ---> System.Net.WebException: The operation has timed out 
       at System.Net.HttpWebRequest.GetResponse() 
       at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout) 
       --- End of inner exception stack trace --- 
       at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason) 
       at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout) 
       at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout) 
       --- End of inner exception stack trace ---


    What is strange is, the workflow tries to consume the service 3 times. The workflow in my environment machine works without any problem at first try... 

    However, for the integration server, It happens that it can reach the service at the second times, and sometimes it can't either for the 3 retries... It usually happen when the workflow didnt consume the service for a while...

            private void GetInfo()
            {
                ServiceClient client = null;
                _retrieveOk = false;
                int retryCount = 0;
                while (!_retrieveOk)
                {
                    try
                    {
                        client = new ServiceClient();
                        
                        _rcvIncfo = client.GetInfo(val);
                        _retrieveOk = true;
                        client.Close();
                    }
                    catch (Exception ex)
                    {
                        if (client != null)
                        {
                            client.Abort();
                        }
                        retryCount++;
                        LogComment(String.Format("Problem while retrieving Info... Attempt {0}", retryCount));
                        if (retryCount == 3)
                        {
                            LogComment(ex.Message);
                            break;
                        }
                    }
                }
            }
    

    Usually, when the workflow manages to consume the service at the 2nd time, I can see at the log of the WCF that the workflow didnt reach the service at the first time (no log for the time when it should be consumed), but there is a log for the 2nd attempt...


    Thursday, May 23, 2013 8:25 PM

All replies

  • still cant find a fix... Don't know what the problem is :(
    Friday, May 24, 2013 12:12 PM
  • Hi,

    Probably your issue is related with the fact that somebody had deployed new solution recently before you started to consume web service? I mean that possibly your issue appears not in the random time, but after some person have made some actions on the farm which make it much longer to make a web service call the first time (deploy new solution or do iisreset)? 

    Could it be your case?

    ____________________________________________
    Regards Michael (http://sp2013-blog.com)
    Please, don't forget to press upvote (if answer is helpful) and mark as answer (if it solves your issue)

    Friday, May 24, 2013 10:03 PM
  • Nop nothing...

    I found out that the workflow cannot always consume the WCF service hosted internally using HTTPS with credential authentication. My WCF Service close connexion after 10minutes, and there is always a problem with the first connection, while there is no problem using HTTP.

    Still trying to know where does the problem may come from...

    Tuesday, May 28, 2013 6:39 PM
  • We increased the timeout value, and it turns out that workflow is able to consume the service in HTTPS, but the first call always take more than 2 minutes... the following call are instantly.

    We still don't know why it takes so much time to open the connection. In our test environment, everything was fine.

    We tried to consume the service not in a workflow, but in a windows application and it was also instantly...

    Wednesday, June 5, 2013 3:00 PM