Unhandled exception

M

Matt

Hi all,

What is the possible reason that httpWebRequest.GetRequestStream() might
hang there until a timeout exception? Here is the detail:
I'm using PayPal buynow button and IPN for the payment processing. My own
test goes well with following code:
// code snippet
// post form to PayPal https://www.paypal.com/cgi-bin/websrc
// has a hidden "return" url to mydomain/ipn.aspx
//ipn.aspx
....
try {
HttpWebRequest httpWebRequest =
(HttpWebRequest)WebRequest.Create("https://mydomain/test_ipn.aspx");
....
Response.Write("before GetRequestStream"); //displayed
streamWriter = new StreamWriter(httpWebRequest.GetRequestStream());
Response.Write("after GetRequestStream"); //dispalyed
....
}

//test_ipn.aspx
....
<script runat="server" language="c#">
void Page_Init(Object sender, EventArgs e) {
Response.Write("VERIFIED");
Response.End();
return;
}
</script>

But change above "WebRequest.Create("https://mydomain/test_ipn.aspx")"
to
"WebRequest.Create("http(s)://www.paypal.com/cgi-bin/webscr")"
The process would hang there with timeout WebException or my ipn.aspx page
will be shown as below:
Response.Write("before GetRequestStream"); //displayed
streamWriter = new StreamWriter(httpWebRequest.GetRequestStream());
Response.Write("after GetRequestStream"); //NOT dispalyed, timeout

Any clues?


-matt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top