httpwebrequest

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • cj

    #1

    httpwebrequest

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

    Any ideas?

    Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
    System.EventArg s) Handles Button1.Click
    Dim REQUEST As Net.HttpWebRequ est
    Dim RESPONSE As Net.HttpWebResp onse
    REQUEST = CType(System.Ne t.WebRequest.Cr eateDefault(New
    System.Uri("htt ps://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_reque st>" & _
    "<login>mylogin id</login>" & _
    "<password>mypa ssword</password>" & _
    "</cardtel_request >"


    Dim objStream As System.io.Strea mWriter
    objStream = New StreamWriter(RE QUEST.GetReques tStream(),
    Encoding.UTF8)
    objStream.Write (loginRequest)
    RESPONSE = REQUEST.GetResp onse()

    Dim oString As IO.Stream
    Dim RESP_STRING As String

    oString = RESPONSE.GetRes ponseStream
    RESP_STRING = New IO.StreamReader (oString).ReadT oEnd
    RESPONSE.Close( )

    Debug.WriteLine ("Response: " & RESP_STRING)
    End Sub
  • Steven Cheng[MSFT]

    #2
    RE: httpwebrequest

    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.publi c.dotnet.framew ork.webservices .enhancements

    Comment

    • Cor Ligthert [MVP]

      #3
      Re: httpwebrequest

      Stephen,

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

      Cor


      Comment

      Working...