Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WinHttp timeout issue

Status
Not open for further replies.

NoviceNet

Programmer
May 26, 2005
15
US
I am using WinHttp object to send and receive information (getting a document in terms of bytes and opening on the browser by converting it into PDF). I am not setting any timeout explicitly in my C# program. Sometimes, our clients are coming across 'timeout' error while downloading the document ('Send' operation). Default timeout for send operation is 30 seconds and this is timing out much before that.

My c# code:
-------------
using WinHttp;
string strXmlDoc = "1234"; //unique key to get the document
string url = " WinHttpRequest objHttp = new WinHttpRequest();
objHttp.Open("POST",URL,false);
objHttp.Send(strXmlDoc); ----> Here it is timingout
byte[] results = (byte[]) objHttp.ResponseBody;

I am getting the following error:
---------------------------------

Description: The operation timed out
Source: download document: WinHttp.WinHttpRequest
Stack Trace: at WinHttp.WinHttpRequestClass.Send(Object Body)

What could be the problem?
 
It's the asp page not your winhttp.

Put this at the top of your testpage.asp

session.Timeout=1000 ' 1000 seconds
 
Actually it's not related to ASP page since it's session timeout is way too big. Otherwise this error would have occured quite frequently. This is something related to WinHttp object's timeout settings. Any answer for this issue?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top