Hi all,
What is the possible reason that httpWebRequest. GetRequestStrea m() 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.Cre ate("https://mydomain/test_ipn.aspx") ;
....
Response.Write( "before GetRequestStrea m"); //displayed
streamWriter = new StreamWriter(ht tpWebRequest.Ge tRequestStream( ));
Response.Write( "after GetRequestStrea m"); //dispalyed
....
}
//test_ipn.aspx
....
<script runat="server" language="c#">
void Page_Init(Objec t sender, EventArgs e) {
Response.Write( "VERIFIED") ;
Response.End();
return;
}
</script>
But change above "WebRequest.Cre ate("https://mydomain/test_ipn.aspx") "
to
"WebRequest.Cre ate("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 GetRequestStrea m"); //displayed
streamWriter = new StreamWriter(ht tpWebRequest.Ge tRequestStream( ));
Response.Write( "after GetRequestStrea m"); //NOT dispalyed, timeout
Any clues?
-matt
What is the possible reason that httpWebRequest. GetRequestStrea m() 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.Cre ate("https://mydomain/test_ipn.aspx") ;
....
Response.Write( "before GetRequestStrea m"); //displayed
streamWriter = new StreamWriter(ht tpWebRequest.Ge tRequestStream( ));
Response.Write( "after GetRequestStrea m"); //dispalyed
....
}
//test_ipn.aspx
....
<script runat="server" language="c#">
void Page_Init(Objec t sender, EventArgs e) {
Response.Write( "VERIFIED") ;
Response.End();
return;
}
</script>
But change above "WebRequest.Cre ate("https://mydomain/test_ipn.aspx") "
to
"WebRequest.Cre ate("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 GetRequestStrea m"); //displayed
streamWriter = new StreamWriter(ht tpWebRequest.Ge tRequestStream( ));
Response.Write( "after GetRequestStrea m"); //NOT dispalyed, timeout
Any clues?
-matt