problem in HttpWebResponse GetResponse

Discussion in 'ASP .Net' 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

  2. do you have an internet connection at your web server ? it seems that you
    can not connect to other web server


    -ersin


    "Taner Özyürekoglu" <> wrote in message
    news:OIEW2f$...
    > 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.RaisePo
    stBackEvent(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
    >
    >
    Ersin Gençtürk, May 24, 2005
    #2
    1. Advertising

  3. I have an internet connection on that site.
    "Ersin Gençtürk" <ers[spam]@gencturk.org> wrote in message
    news:...
    > do you have an internet connection at your web server ? it seems that you
    > can not connect to other web server
    >
    >
    > -ersin
    >
    >
    > "Taner Özyürekoglu" <> wrote in message
    > news:OIEW2f$...
    >> 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.RaisePo
    > stBackEvent(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ürekoðlu, May 24, 2005
    #3
  4. ok.do you have the proper permissions to create internet connection ?

    "Taner Özyürekoðlu" <> wrote in message
    news:%23q$...
    > I have an internet connection on that site.
    > "Ersin Gençtürk" <ers[spam]@gencturk.org> wrote in message
    > news:...
    > > do you have an internet connection at your web server ? it seems that

    you
    > > can not connect to other web server
    > >
    > >
    > > -ersin
    > >
    > >
    > > "Taner Özyürekoglu" <> wrote in message
    > > news:OIEW2f$...
    > >> 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.RaisePo
    > > stBackEvent(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
    > >>
    > >>

    > >
    > >

    >
    >
    Ersin Gençtürk, May 25, 2005
    #4
    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. Satinderpal Singh

    HttpWebResponse/HttpWebRequest problem...

    Satinderpal Singh, Jun 2, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    3,786
    Satinderpal Singh
    Jun 4, 2004
  2. Satinderpal Singh

    problem with HttpWebRequest/HttpWebResponse...

    Satinderpal Singh, Jun 2, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    4,867
    bruce barker
    Jun 2, 2004
  3. japslam japslam via DotNetMonster.com

    Please help !! Problem about HttpWebRequest - GetResponse()

    japslam japslam via DotNetMonster.com, Apr 22, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    10,877
    Bruce Barker
    Apr 22, 2005
  4. bg
    Replies:
    5
    Views:
    7,358
  5. Taner Özyürekoglu

    HttpWebResponse GetResponse

    Taner Özyürekoglu, May 24, 2005, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    113
    Taner Özyürekoglu
    May 24, 2005
Loading...

Share This Page