When should you use XML serialization?

I am reading on serialization XMLand from what I understand, This is a way to take an object and save the state in a file. As for the implementation, it looks fairly straightforward, and it seems that there are a lot of resources for its application. When should serialization be used XML? What are the benefits? What are the situations that best help with this?

+3
source share
5 answers

You answered a little to the question in your post. This is great for preserving the state of an object. I used it in applications to save user settings. This is also a great way to send data to other systems as it is standardized. It is important to remember that it is easy to read by humans. This can be good or bad depending on your situation. You might want to encrypt it or use encrypted binary serialization if you do not want anyone else to understand it.

EDIT:
Another noteworthy one is that the implemented .NET XMLSerializeronly serializes public elements in an object. If you need to keep personal or protected members, you will need to either use a customized serializer or use a different form of serialization.

+2

.NET XmlSerializer XML. DataContractSerializer , XML, .

XmlSerializer , , , , , - ASMX, Microsoft " ".

DataContractSerializer, WCF.

+3

. . Java # - XML. XML . , , XML .

+1

- XML- -. , ( ) /, , , (.. ), XML .

0

class, , HttpWebRequest, , im HttpWebRequest + Soap ( Im writing), Soap String, int,....

XML XML HttpWebRequest.

0

Source: https://habr.com/ru/post/1754675/


All Articles