sending XML over a socket

  • Thread starter Thread starter abdul bari
  • Start date Start date
It really depends on how the XML is stored on the server. Is it made
available as a file over HTTP, FTP, or SMB? Or is it dynamically generated
as it's being sent?

Chris
 
Have you considered using web services or remoting?

All the socket menutiae is handled for you.

Other than that, you'll need to either use an XmlTextWriter
to stream the XML over the socket, or do it manually by
using a text encoder from the System.Text space. UTF8 is the
most common. You can convert an XML string into a byte[]
which you can send over the socket. On the other end, use
your XmlTextReader, or the Encoding.UTF8 to turn it back
into an XML Document or an XML string respectively.

-c
 
Back
Top