C
Carl Howarth
Hi,
I am trying to write a class to interface with a payment gateway (via an XML
string). I have managed to get this to work using the VB6 version of code,
but would rather like to use the .net webrequest/response techniques.
The VB6 style code I am using that works is as follows:
Dim xbroker As New MSXML2.ServerXMLHTTP
xbroker.open("POST", "http://127.0.0.1:5001/", False)
xbroker.send(stXML)
MsgBox(xbroker.responseText)
.............
The VB.NET code that is currently coming back with "(100) Timeout reading
from socket" is as follows:
Dim req As WebRequest
Dim rsp As WebResponse
Dim stResult As String
req = WebRequest.Create("http://127.0.0.1:5001/")
req.Method = "POST"
req.ContentType = "text/xml"
rsp = req.GetResponse
reader = New StreamReader(rsp.GetResponseStream)
MsgBox(reader.ReadToEnd)
reader = Nothing
If Not rsp Is Nothing Then rsp.GetResponseStream.Close()
..............................
Any ideas please?
Thanks in anticipation,
Carl
I am trying to write a class to interface with a payment gateway (via an XML
string). I have managed to get this to work using the VB6 version of code,
but would rather like to use the .net webrequest/response techniques.
The VB6 style code I am using that works is as follows:
Dim xbroker As New MSXML2.ServerXMLHTTP
xbroker.open("POST", "http://127.0.0.1:5001/", False)
xbroker.send(stXML)
MsgBox(xbroker.responseText)
.............
The VB.NET code that is currently coming back with "(100) Timeout reading
from socket" is as follows:
Dim req As WebRequest
Dim rsp As WebResponse
Dim stResult As String
req = WebRequest.Create("http://127.0.0.1:5001/")
req.Method = "POST"
req.ContentType = "text/xml"
rsp = req.GetResponse
reader = New StreamReader(rsp.GetResponseStream)
MsgBox(reader.ReadToEnd)
reader = Nothing
If Not rsp Is Nothing Then rsp.GetResponseStream.Close()
..............................
Any ideas please?
Thanks in anticipation,
Carl