In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the knowledge of "what is WCF serialization". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Recently read a lot of information about WCF, in-depth understanding of the principle and mechanism of WCF, we all know that WCF has two built-in serialization methods, DataContractSerializer and NetDataContractSerializer. Now let's briefly analyze and introduce the knowledge of WCF serialization.
Let's take a look at the declaration of WCF serialization:
Public sealed class DataContractSerializer: XmlObjectSerializer {public DataContractSerializer (Type type); … Public override object ReadObject (XmlReader reader); public object ReadObject (Stream stream); public void WriteObject (Stream stream, object graph); public override void WriteObject (XmlWriter writer, object graph); … } public sealed class NetDataContractSerializer: XmlObjectSerializer, IFormatter {public NetDataContractSerializer (); … Public object Deserialize (Stream stream); public void Serialize (Stream stream, object graph); public override object ReadObject (XmlReader reader); public object ReadObject (Stream stream); public void WriteObject (Stream stream, object graph); public override void WriteObject (XmlWriter writer, object graph); … }
The implementations of ReadObject (Straem) and WriteObject (Stream, object) are inherited from the base class XmlObjectSerializer, and the other methods are overridden or implemented. You can see from the declarations of both types that NetDataContractSerializer implements the IFormatter interface, while DataContractSerializer does not, so only NetDataContractSerializer can use serialization in the .NET infrastructure, while DataContractSerializer is dedicated to WCF. There is also a detail that DataContractSerializer's Constructor has a parameter of type Type, while NetDataContractSerializer does not. There is a profound meaning in this, and the reader will understand it.
That's all for what WCF Serialization is. Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.