WCF API部署版本 [英] WCF API Deployment Versioning

查看:128
本文介绍了WCF API部署版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是在寻找开发.NET WCF API。我们可能需要经常更新的API。

I was just looking to develop .NET WCF API. We may need to frequently update APIs.

如何管理API部署的多个版本?

How to manage multiple versions of API deployment?

推荐答案

版本控制你的服务是许多注意事项和准则一个很大的话题。

Versioning your services is a huge topic with many considerations and guidelines.

一开始,有不同的类,你可以更改的;充分破,半断和非断裂。

For a start, there are different classes of changes you can make; fully-breaking, semi-breaking, and non-breaking.

非破坏性变更(无需对现有客户其他城市)包括:

Non-breaking changes (no change needed to existing clients) include:


  • 改变内部实现服务的同时保持暴露合同不变

  • 改变合同类型在不破的客户,例如,通过添加字段到您的操作返回类型(在反序列化遇到意想不到的领域时,大多数的序列化将引发一个事件,而不是抛出一个异常)的方式

  • 多态暴露的新类型(使用ServiceKnownType属性)

  • 改变服务实例的管理设置(每次呼叫独居,无会话到sessionful等,虽然有时这需要配置甚至code的变化)

半断的变化(通常可以在客户端进行配置)inlcude:

Semi-breaking changes (usually can be configured on the client) inlcude:


  • 更改服务的位置

  • 改变传输类型的服务跨暴露(尽管从双向改为单向交通 - 例如http到MSMQ - 可以是完全破变化)

  • 改变服务的可用性(通过使用服务窗口等)

全破的变化(需要在客户端的新版本),包括:

Fully-breaking changes (need new version of the client) include:


  • 更改服务操作签名

  • 在一个破碎的方式改变暴露类型(删除字段等)

当你准备做一个半或完全重大更改,你应该评估这样做的最佳方式。你是否强制所有客户端升级到使用新版本,或者你共同主持在不同的端点服务的两个版本?如果选择后者,那么你将如何控制和管理不同versionning依赖此可能引入的传播?

When you are going to make a semi or fully breaking change, you should evaluate the best way of doing this. Do you force all your clients to upgrade to use the new version, or do you co-host both versions of the service at different endpoints? If you choose the latter then how will you control and manage the propagation of different versionning dependencies which this may introduce?

两者发挥到了极致,你可以看看动态的端点解决方案,从而客户端解析合适的端点使用某种解析服务在运行时调用。

Taken to an extreme, you could look into dynamic endpoint resolution, whereby the client resolves the suitable endpoint to call at runtime using some kind of resolver service.

有这个好这里阅读:
<一href=\"http://msdn.microsoft.com/en-us/library/ms731060.aspx\">http://msdn.microsoft.com/en-us/library/ms731060.aspx

这篇关于WCF API部署版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆