惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
The Register - Security
The Register - Security
Hugging Face - Blog
Hugging Face - Blog
博客园 - 聂微东
GbyAI
GbyAI
Recent Commits to openclaw:main
Recent Commits to openclaw:main
博客园_首页
D
Docker
S
Security @ Cisco Blogs
K
Kaspersky official blog
爱范儿
爱范儿
Simon Willison's Weblog
Simon Willison's Weblog
TaoSecurity Blog
TaoSecurity Blog
V
V2EX
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Troy Hunt's Blog
Cloudbric
Cloudbric
博客园 - 三生石上(FineUI控件)
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
The Hacker News
The Hacker News
美团技术团队
S
SegmentFault 最新的问题
L
Lohrmann on Cybersecurity
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
宝玉的分享
宝玉的分享
The Last Watchdog
The Last Watchdog
Y
Y Combinator Blog
M
MIT News - Artificial intelligence
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Martin Fowler
Martin Fowler
Google Online Security Blog
Google Online Security Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
C
Cybersecurity and Infrastructure Security Agency CISA
T
Tor Project blog
Vercel News
Vercel News
The Cloudflare Blog
G
Google Developers Blog
T
Threat Research - Cisco Blogs
AI
AI
Stack Overflow Blog
Stack Overflow Blog
I
InfoQ
Scott Helme
Scott Helme
S
Schneier on Security
大猫的无限游戏
大猫的无限游戏
The GitHub Blog
The GitHub Blog
S
Securelist
IT之家
IT之家
Microsoft Azure Blog
Microsoft Azure Blog

博客园 - JerryShi

使用流模式传输大型数据 对象序列化之 替换(Surrogate) 使用 IExtensibleDataObject 进行往返式序列化 使用 NetDataContractSerializer 共享类型 WCF可序列化方式 自定义 Behavior 操作行为 之 事务 服务行为 之 元数据 服务行为 之 并发与实例化 基本的WCF编程(实例) WCF Behaviors(行为) WCF 体系结构 WCF服务 使用netTcpBinding 无法打开默认数据库 SharePoint 创建SSP时出现找不到 Windows NT 用户或组 的异常 SQL Server 2008 Mirror 泛型(一) 自定义属性Attribute(三) 自定义属性Attribute(二)
序列化 VS 编码
JerryShi · 2011-10-22 · via 博客园 - JerryShi

DataContract序列化机制,将CLR类型转换成符合标准的XML,在客户端与服务之间进行传输。然而有许多情况下DataContract序列化机制不足以完成工作。

WCF并没有遵循序列化的标准定义,而是将序列化定义为将对乡土转化为XML信息集(XML Infoset) 的过程。XML Infoset 是一个数据模型,WCF用它在内部表示一个消息。

System.ServiceModel.Chnnels.Message是代表XML Infoset的类。

XML Infoset 是用来表示XML文档的数据类型,也是XML的基本抽象定义。

XML与XML Infoset之间的关键区别:XML Infoset未指定一种特定的格式,所以,尽管XML标准使用的是文本格式,XML Infoset却没有任何限制。

XML Infoset 与 XML相比的优势:只要消息是基于XML Infoset的,WCF就可以用不同的格式来表示它,其中包括了XML1.1规范制定的文本格式,也可以是其他格式如二进制。也可以使用XML,同时可以根据互通性和性能要求选择合适的消息格式。

XML Infoset

编码描述将WCF消息转化成字节数组的过程,这样消息才能通过传输协议进行发送。

WCF提供5种编码方式:二进制、文本、消息传输优化机制(MTOM)、JSON、XML。

如果想在.NET 应用程序之间获得最佳性能,应选用BiaryMessageEncoder;

如果要基于WS-*的Web Service, 则应选用TextMessageEncoder和MtomMessageEncoder;

如果要基于Ajax应用通信,则应选用JsonMessageEncoder;

如果已有的编码器不能满足要求,则可以扩展WCF来支持新的编码器;