RE: Send and receive XML using tcpclient
- From: Philip Wagenaar <philip.wagenaar@xxxxxxxxxxxxx>
- Date: Tue, 16 Aug 2005 01:09:03 -0700
Anyone?
"Philip Wagenaar" wrote:
> I have a server (tcp/ip) that receives and sends back XML.
>
> When I use the following code to send a login xml string my application
> hangs. I think it is waiting for somekind of notification that the return xml
> string has ended.
>
> Dim LoginXml As XmlDocument = New XmlDocument
> LoginXml.Load("Login.xml")
> Dim newClient As TcpClient = New TcpClient
> newClient.Connect(TextBox2.Text, TextBox3.Text)
> Dim tcpStream As NetworkStream = newClient.GetStream
> Dim xmlFile As String = LoginXml.OuterXml
> Dim sendBytes() As Byte = Encoding.UTF8.GetBytes(xmlFile + "\r\n")
> tcpStream.Write(sendBytes, 0, sendBytes.Length)
> Dim strReader As streamreader = New
> StreamReader(newClient.GetStream())
> Dim returnData As String = strReader.ReadLine()
> LoginXml.LoadXml(returnData)
> Dim filename As String = "response.xml"
> LoginXml.Save(filename)
>
> Where am I going wrong?
.
- References:
- Send and receive XML using tcpclient
- From: Philip Wagenaar
- Send and receive XML using tcpclient
- Prev by Date: Re: API Declaration Styles
- Next by Date: How do I Abort/Delayed Shutdown
- Previous by thread: Send and receive XML using tcpclient
- Next by thread: Q: Regular expression
- Index(es):
Relevant Pages
|