Click to See Complete Forum and Search --> : how to send xml over sockets


apollo135
December 21st, 2009, 01:48 AM
HI,

I found on the net that when exchanging data program running on windows and another on Unix, XML can be used to avoid endlessness. Does anyone please explain with an example, how?

hoxsiew
December 21st, 2009, 10:43 AM
Since XML is character based, there is no byte ordering problem since bytes are bytes in either bigendian or littleendian systems.

apollo135
December 22nd, 2009, 06:07 AM
Yes! I know that XML is character base ...
But how to exchange it via sockets written in C/C++
Thanks for the reply

hoxsiew
December 22nd, 2009, 09:05 AM
I'm not sure what it is you are asking for. The sockets don't care what kind of data you are exchanging. Sockets handle byte streams and don't care whether it's XML or a JPEG file; it's all bytes to the socket.

apollo135
December 22nd, 2009, 02:30 PM
thanks for your reply...
probably you are talking about the file. the problem is not when exchanging a file but when exchange XML as a struct / class
E.G. when we exchange struct between program running on Unix and other on Windows, we have to take care of padding, byte alignment and ordering, and endianness issues , right!
So instead of sending struct() function, we can to send an XML schema , according to some information on the net. As there is no details about, I would appreciate if you could describe how?
Thanks