Notifications
Clear all

[Closed] Serialization of XML to be sent over socket connection

Hello. I’ve been having difficulty finding good documentation that I can easily understand, but what I have right now is a maxscript generating an xml structure (using the system.xml.xmldocument… .net assembly) then establishing a tcp socket connection to an external tcp service, however if I just “send” the variable containing the xml data – it will just be sending a .net class… I believe what I need to do is searlize the xml file am I correct? I’d assume into a UTF8 type format which can then be handled on the receiving end? however I am unsure of how to do this. Could someone point me in the right direction (I even tried browsing the msdn .net docs but… I am not even knowledgeable enough to know which language implementation I should be using it gives examples in vb, c#, C++, etc…). I’d really appreciate any help.
Tks!

5 Replies

Have you looked in the XML class for something like XML.ToString() ? I’m not in my PC and I don’t know it by heart but maybe this helps.

Hi

Take a look at this article, I discuss XML serialization towards the end. Hope it gives you a start.

http://lonerobot.net/?p=840

Thank you both of you I really appreciate.
So I guess this is specifically to lone robot:
Again, thank you, I did some research concurrently and found something like this “xmlserilizer” and “Streamwriter” – and I checked the page you referred to. So, yes that’s exactly what I need, also, towards the end you compare a line of VB to Maxscript – that is where I am having also the biggest problem but I saw your tutorial on the .net language – so hopefully when I have the chance (next Wednesday) I’ll try to get it into working code… I just wanted to answer as I appreciate the help – when completed I’ll post the working chunk of code (maybe it’ll help someone else).

Serialization of XML to be sent over socket connection

is it more than http://forums.cgsociety.org/showthread.php?f=98&t=937238&highlight=xml ?

Tks Denis, looks like that does it. Thanks v much. pretty simple after all…
(and thanks everyone for your posts – I learned a healthy bit out of all that) I appreciate the help greatly.