HttpWebResponse GetResponse

Discussion in 'ASP .Net Web Services' started by Taner Özyürekoglu, May 24, 2005.

  1. I have an error below. is there any idea about it.


    Dim Req As HttpWebRequest =
    WebRequest.Create("https://certification.authorize.net/gateway/transact.dll?"
    & postdata)
    Response.Write("3")
    Req.Method = "POST"
    Req.AllowAutoRedirect = True
    Req.Proxy = System.Net.WebProxy.GetDefaultProxy()
    Req.Timeout = 100000
    Req.ProtocolVersion = HttpVersion.Version11
    Req.ContentLength = postdata.Length
    Req.ContentType = "application/x-www-form-urlencoded"
    Req.KeepAlive = False
    postdata = ""
    Req.ContentLength = postdata.Length
    Req.AllowWriteStreamBuffering = True

    Dim result As String
    Dim objResponse As HttpWebResponse = Req.GetResponse()
    Dim sr As StreamReader
    sr = New StreamReader(objResponse.GetResponseStream())
    result = sr.ReadToEnd
    Response.Write(result)
    sr.Close()




    An unhandled exception was generated during the execution of the current web
    request. Information regarding the origin and location of the exception can
    be identified using the exception stack trace below.

    Stack Trace:

    [WebException: The underlying connection was closed: Unable to connect to
    the remote server.]
    System.Net.HttpWebRequest.CheckFinalStatus() +677
    System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) +140
    System.Net.HttpWebRequest.GetResponse() +249
    WebMeals.CC.Button1_Click(Object sender, EventArgs e)
    System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
    System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
    eventArgument) +57
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
    sourceControl, String eventArgument) +18
    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
    System.Web.UI.Page.ProcessRequestMain() +1292
    Taner Özyürekoglu, May 24, 2005
    #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. Dayakar

    GetResponse() Error in .NET 2003

    Dayakar, Jul 9, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    361
    Dayakar
    Jul 9, 2003
  2. Steven Campbell

    Re: Timeout in GetResponse

    Steven Campbell, Aug 26, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    361
    Steven Campbell
    Aug 26, 2003
  3. Simon Devlin
    Replies:
    0
    Views:
    461
    Simon Devlin
    Nov 12, 2003
  4. Jeff B
    Replies:
    1
    Views:
    13,154
    Rick Strahl [MVP]
    Dec 20, 2003
  5. Taner Özyürekoglu

    problem in HttpWebResponse GetResponse

    Taner Özyürekoglu, May 24, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    6,405
    Ersin Gençtürk
    May 25, 2005
Loading...

Share This Page