473,320 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

[WebException: The operation has timed-out.]

(can't find any of my previous post for same issue. please CC to my email
address as well. Thanks!)

Hi all,
What is the possible reason that HttpWebRequest.GetRequestStream() may hang
there until a timeout exception. Here is the stack trace and code snippet.
Please do help. --Matt
// stack trace
[WebException: The operation has timed-out.]
System.Net.HttpWebRequest.GetRequestStream() +190
ASP.ipn_aspx.Page_Init(Object sender, EventArgs e) +510
System.Web.UI.Control.OnInit(EventArgs e) +67
System.Web.UI.Control.InitRecursive(Control namingContainer) +235
System.Web.UI.Page.ProcessRequestMain() +171
----------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.0.3705.288; ASP.NET
Version:1.0.3705.288
Request Details
Session Id: lu21i0a3kfj5sj45wy41yx45 Request Type: POST
Time of Request: 1/10/2004 8:36:38 AM Status Code: 500
Request Encoding: Unicode (UTF-8) Response Encoding: Unicode (UTF-8)
Trace Information
Category Message From First(s) From Last(s)
Before try 0.000222 0.000222
Before grs 0.000389 0.000167
aspx.page Begin Init
Unhandled Execution Error
The operation has timed-out.
at System.Net.HttpWebRequest.GetRequestStream()
at ASP.ipn_aspx.Page_Init(Object sender, EventArgs e)99.999137 99.998748
/* these are proper values? */
at System.Web.UI.Control.OnInit(EventArgs e)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Page.ProcessRequestMain() Control Tree
Control Id Type Render Size Bytes (including children) Viewstate Size Bytes
(excluding children)
Cookies Collection
Name Value Size
ASP.NET_SessionId lu21i0a3kfj5sj45wy41yx45 42
Headers Collection
Name Value
Cache-Control no-cache
Connection Keep-Alive
Via 1.0 CR37543-A
Content-Length 807
Content-Type application/x-www-form-urlencoded
Accept image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/x-shockwave-flash, application/vnd.ms-excel, application/msword,
*/*
Accept-Language en-us
Host 192.168.16.2:81
Referer
https://www.paypal.com/row/cgi-bin/w...confirm-submit
User-Agent Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR
1.0.3705)
Form Collection
Name Value
mc_gross 0.01
address_status unconfirmed
.....

// code snippet
<%@ Page Language="C#" Trace="true" TraceMode="SortByCategory" %>
<%@ Import Namespace="System.Web.Security " %>
<%@ Import namespace="System.Data" %>
<%@ Import namespace="System.Data.SqlClient" %>
<%@ Import namespace="System.Net" %>
<%@ Import namespace="System.IO" %>
<%@ Import Namespace="System.Web.Mail" %>
<script runat="server" language="c#">
static String strans;
static String un;
String pwd = "";
void Page_Init(Object sender, EventArgs e) {
String strresponse = "", strstatus = "";
int i;
String item_name = "", item_number = "", payment_status = "", mc_gross =
"", mc_currency = "";
String txn_id = "", receiver_email = "", payer_email = "";
String url = "https://www.paypal.com/cgi-bin/webscr";
string stringPost = Request.Form.ToString();
item_name = item_name + Request["item_name"];
...
payer_email = payer_email + Request["payer_email"];
// try
// {
HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(url);
httpWebRequest.Method = "POST";
httpWebRequest.ContentLength = stringPost.Length + 21; // length plus 21
because &cmd=_notify-validate is 21 chars long
httpWebRequest.ContentType = "application/x-www-form-urlencoded";
//StreamWriter streamWriter = null;
Trace.Write("Before grs");
StreamWriter streamWriter = new
StreamWriter(httpWebRequest.GetRequestStream());
Trace.Write("After grs");
stringPost = stringPost + "&cmd=_notify-validate";
streamWriter.Write(stringPost);
streamWriter.Close();
HttpWebResponse httpWebResponse =
(HttpWebResponse)httpWebRequest.GetResponse();
if (httpWebResponse.StatusCode == HttpStatusCode.OK) {
using (StreamReader streamReader = new
StreamReader(httpWebResponse.GetResponseStream()))
{
strresponse = strresponse + streamReader.ReadToEnd();
streamReader.Close();
}
strstatus = strstatus + strresponse;
} else {
....

Nov 18 '05 #1
0 1552

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: genc_ ymeri at hotmail dot com | last post by:
Hi, I'm trying to recieve the response status code rather than the message in the below code : try { responseArray = myWebClient.UploadValues(uriString,"POST",myNameValueCollection); }...
2
by: Javaman59 | last post by:
I have a GUI which is monitoring a real-time device. I have several timed actions, such as periodic polling of the device, and indicators which flash for a fixed period. My first implementation...
2
by: G Joseph | last post by:
Hello, I am getting a WebException.TrustFailure when I call HttpwebRequest.GetResponse. Anybody has an idea how to resolve this issue? The code works correctly in other sites. I noticed that,...
0
by: Joey Guerra | last post by:
Hi. I've been researching how to resolve this issue, but haven't found a solution. I saw a post referring to the SecureChannelFailure WebException status, but no resolution. Any help/direction is...
1
by: Marcos Martínez | last post by:
I am trying to generate and to consume a file RSS dinamicamente. I generate it correctly, if I call from the explorer (http://localhost/Prueba/rss.aspx) or an application client RSS Bandit, for...
1
by: Tim Reynolds | last post by:
Team, From a windows service, we consume a web service on another server and occasionally receive System.Net.WebException: The underlying connection was closed:. For some clients we call, we do...
8
by: Tim Reynolds | last post by:
Our .Net application calls a web method of aplpication 2 that resides on their Apache server. When I as a developer C#, Studios 2003, make the call to their web method from my desktop, I receive no...
2
by: Daniel | last post by:
Hi How do i set a socket to wait for a reply after a set time frame? For example the following scenarios: 1) Give a user 10 seconds to respond after which time send an automatic message to...
2
by: Scott McFadden | last post by:
When I invoke two web service methods sequentially with no delay, the first web method invocation goes smooth while the 2nd one generates the dredded: System.Net.WebException: The underlying...
4
by: =?Utf-8?B?UGhpbGlwIEs=?= | last post by:
Simplifying the code a bit its like this: try { myRemotingObj.Myfunction(string, string,string,string,timeSpan) } catch(WebException) { commsUp = false; }
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.