Hello I am calling a web service with the following code:
1 Dim postData As String
2 Dim encoding As ASCIIEncoding
3 Dim viaRequest As HttpWebRequest = WebRequest.Create("http://72.222.111.00/WebService/WebService.asmx/RequestSnapshot?
4 postData = "URLRequested=" & URLRequested & "&imageFileName=" & imageFileName & "&CaptureType=Realtime"
5 viaRequest.Method = "POST"
6 viaRequest.ContentType = "application/x-www-form-ur
7 viaRequest.ContentLength = postData.Length
8 viaRequest.Timeout = "15000"
10 Dim writer As StreamWriter = New StreamWriter(viaRequest.Ge
14 Dim r As HttpWebResponse = viaRequest.GetResponse
15 Dim reader As New StreamReader(r.GetResponse
16 Dim respPage As String = reader.ReadToEnd
How can I process some code IF the request takes more than 15 seconds. I do have a timeout set of 15 seconds but it will not work becuase It will end the request after 15 seconds. What I would like to accomplish is to process some other code if the request takes longer than 15 seconds but without ending the request to the web service as timeout does. How can i do this?
Thanks Very Much!!