WCF Contracts and Backward Compatibility
来源:互联网 发布:如何理解数组的概念 编辑:程序博客网 时间:2024/06/06 01:26
WCF contracts are version tolerant by default. Figure 1 and Figure 2 summarize typical changes to service contracts and data contracts and describe the impact to existing clients. In short, the DataContractSerializer allows missing, non-required data and ignores superfluous data for service contracts, data contracts and similarly, message contracts. Only the removal of operations or the addition or removal of required data causes problems with existing clients.
Figure 1: Service contracts and backward compatibility
Adding new parameters to an operation signature
Client unaffected. New parameters initialized to default values at the service.
Removing parameters from an operation signature
Client unaffected. Superfluous parameters pass by clients are ignored, data lost at the service.
Modifying parameter types
An exception will occur if the incoming type from the client cannot be converted to the parameter data type.
Modifying return value types
An exception will occur if the return value from the service cannot be converted to the expected data type in the client version of the operation signature.
Adding new operations
Client unaffected. Will not invoke operations it knows nothing about.
Removing operations
An exception will occur. Messages sent by the client to the service are considered to be using an unknown action header.
Figure 2: Data contracts and backward compatibility
Add new non-required members
Client unaffected. Missing values are initialized to defaults.
Add new required members
An exception is thrown for missing values.
Remove non-required members
Data lost at the service. Unable to return the full data set back to the client, for example. No exceptions.
Remove required members
An exception is thrown when client receives responses from the service with missing values.
Modify existing member data types
If types are compatible no exception but may receive unexpected results.
- WCF Contracts and Backward Compatibility
- WCF-Contracts
- WCF 4 Step By Step Chapter 6 Note (Maintaining Service Contracts and Data Contracts)
- 【Backward Compatibility for Applications】向后兼容程序
- MEF Composable Parts and Contracts
- WCF service implementing multiple service contracts
- Protocols and behavioral compatibility
- 对话#28:Contracts, Promises, and Mere Semantics
- Contracts, Tax, and Banking 填写流程
- android compatibility and System Permissions
- WCF 学习笔记心德体会(一)------契约(Contracts)
- Caffe学习:Forward and Backward
- Caffe学习:Forward and Backward
- Caffe学习:Forward and Backward
- HTML5 compatibility on mobile and tablet browsers
- lock compatibility / Lock Granularity and Hierarchies
- Information Technology Outsourcing Transactions : Process, Strategies, and Contracts
- iTunes Connect中的Contracts, Tax, and Banking设置
- 第十一周项目 0 阅读程序(1.1)
- 第十三周【项目3-立体类族共有的抽象类】
- SqlServer的优化
- 数据清洗小记(2):全角数字转换半角数字
- 十三周项目二
- WCF Contracts and Backward Compatibility
- opencv鼠标操作cvSetMouseCallback和文本显示cvPutText的总结
- BIRT Viewer 参数配置详解
- listview更改选中时item背景色
- 第十三周项目:动物这样叫(3)
- python的virtualenv环境与使用
- 项目2-形状类族中的纯虚函数
- 2015-第十三周课后自主-动物怎么叫:虚函数
- 发邮件 用base64解码账号密码 方便调试