httpwebrequest

C

cj

As best I can figure this should return me something from the host but
it hangs on RESPONSE = REQUEST.GetResponse()

Any ideas?

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim REQUEST As Net.HttpWebRequest
Dim RESPONSE As Net.HttpWebResponse
REQUEST = CType(System.Net.WebRequest.CreateDefault(New
System.Uri("https://webtsdtest.tnsi.com/soap/servlet/rpcrouter")),
HttpWebRequest)
REQUEST.Method = "POST"
REQUEST.Accept = "text/xml"


Dim loginRequest As String = "<?xml version=""1.0""
encoding=""ISO-8859-1""?>" & _
"<cardtel_request>" & _
"<login>myloginid</login>" & _
"<password>mypassword</password>" & _
"</cardtel_request>"


Dim objStream As System.io.StreamWriter
objStream = New StreamWriter(REQUEST.GetRequestStream(),
Encoding.UTF8)
objStream.Write(loginRequest)
RESPONSE = REQUEST.GetResponse()

Dim oString As IO.Stream
Dim RESP_STRING As String

oString = RESPONSE.GetResponseStream
RESP_STRING = New IO.StreamReader(oString).ReadToEnd
RESPONSE.Close()

Debug.WriteLine("Response: " & RESP_STRING)
End Sub
 
S

Steven Cheng[MSFT]

Hi Cj,

Thanks for posting. Regarding on this issue, I've posted my response and
suggestion in your another duplicated thread in the following newsgroup:

microsoft.public.dotnet.framework.webservices.enhancements
 
C

Cor Ligthert [MVP]

Stephen,

If you just had answered it crossposted, than we could have seen it as well.

Cor
 

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

Top