HttpWebResponse GetResponse

  • Thread starter Taner Özyürekoglu
  • Start date
T

Taner Özyürekoglu

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
 

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,022
Latest member
MaybelleMa

Latest Threads

Top