Timeout Error during GetResponse method

Timeout Error during GetResponse method

We are using the Zoho API to edit documents with our web application.

 

One of our users has been using the zoho interface on our web site to edit their excel document. Till recently they were able to edit the document “AR WRS Inventory Control Reports Draft II.xlsx” (tried to attach, but, getting blank error while attaching).

 

Then they made some changes to it “AR WRS Inventory Control Reports Draft III.xlsx” (tried to attach, but, getting blank error while attaching), and the document cannot be pulled up in Zoho.

 

The error that we are getting is “The operation has timed out”, when  the GetResponse method is invoked.

 

Please help!

 

Here is the block of code which contains the GetResponse method that we are calling (line where error is happening is highlighted in yellow):

 

    Private Function getHttpWebResponse(ByVal sPostURL As String, ByVal sQueryStrParam As String, ByRef vError As String) As String

        Dim objRequest As System.Net.HttpWebRequest = Nothing

        Dim objResponse As System.Net.HttpWebResponse = Nothing

        Dim sResponseStr As String = String.Empty

        Try

            ' Do  web request  here 

            objRequest = DirectCast(WebRequest.Create(sPostURL), HttpWebRequest)

 

            objRequest.Method = "POST"

            'When Special characters are available in PostData then to get actual number of bytes else get the error.

            objRequest.ContentLength = Encoding.UTF8.GetBytes(sQueryStrParam).Length

            objRequest.ContentType = "application/x-www-form-urlencoded"

 

            Dim objWriter As StreamWriter = Nothing

            Try

                objWriter = New StreamWriter(objRequest.GetRequestStream())

                objWriter.Write(sQueryStrParam)

            Catch ex As Exception

                LogException("", "", G_UnexpectedError, ex)

                Throw ex

            Finally

                If Not objWriter Is Nothing Then

                    objWriter.Close()

                End If

            End Try

 

            Dim objreader As StreamReader

            Try

                ' Get response  

                objResponse = DirectCast(objRequest.GetResponse(), HttpWebResponse)

 

                ' Get the response stream into a reader  

                objreader = New StreamReader(objResponse.GetResponseStream())

 

                'Response string

                sResponseStr = objreader.ReadToEnd()

            Catch ex As Exception

                'there was an error communicating with server

                LogException("", "", "Error occured while Getting Zoho Response. QueryStringParam :" & sQueryStrParam & "; PostURL:" & sPostURL, ex)

                vError = "e1045:Error occured while Getting Zoho Response."

            Finally

                If Not objResponse Is Nothing Then

                    objResponse.Close()

                End If

            End Try

        Catch ex As Exception

            vError = G_UnexpectedError

            LogException("", "", "( Post Url:" & sPostURL & sQueryStrParam & " ) ", ex)

        End Try

        Return sResponseStr