Unhandled exception

Discussion in 'ASP .Net' started by Matt, Jan 9, 2004.

  1. Matt

    Matt Guest

    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
    Matt, Jan 9, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Amit
    Replies:
    8
    Views:
    3,768
    Alan Pretre
    Aug 4, 2003
  2. Pardhasaradhy
    Replies:
    1
    Views:
    518
    Natty Gur
    Jul 9, 2003
  3. Ola
    Replies:
    0
    Views:
    522
  4. Tedka
    Replies:
    2
    Views:
    2,655
    Mr. Dot Net
    Jul 19, 2004
  5. Warren Tang
    Replies:
    1
    Views:
    863
    Warren Tang
    Sep 23, 2008
Loading...

Share This Page