ServiceBehaviour 的命名空间对于 Web 服务版本控制重要吗?

发布于 2024-12-26 07:11:38 字数 840 浏览 1 评论 0 原文

很简单……ServiceBehaviour 的命名空间对于 Web 服务版本控制很重要吗?这意味着为了客户端与服务器的前向/后向兼容性,此名称空间是否以任何方式涉及?

我真的不明白这个特定的命名空间是什么以及它的用途。有人可以告诉我这个吗?

谢谢你!

EDIT1:经过我的调查,此名称空间出现在 WSDL 中的第一行中: ...但我不知道这是否会影响版本控制...也许我是盲目的或错过了一些东西。或者也许我太担心了......为什么我要在这里添加一些日期(< /代码>) ?

EDIT2:我找到了此链接,但指向另一个不再可用的位置:http://social.msdn.microsoft.com/Forums/en/wcf/thread/66c19783-6675-4bd7-83c1-2140d00a943e 。有人可以帮忙吗?

Simple, as that... is the ServiceBehaviour's namespace important for web service versioning? Meaning that for forward/backward compatibility of clients to server is this namespace involved in any way?

I really didn't understand what is this specific namespace and its use. Could anybody enlighting me about this?

Thank you!

EDIT1: After my investigations this namespace appears in WSDL here in the first line: <wsdl:definitions name="SvcTest" targetNamespace="api.company.com/Services/Tester"> ...but I don't see if this would influence or not the versioning... maybe I am blind or miss something. Or maybe I am too worried... why would I add some date here (<wsdl:definitions name="SvcTest" targetNamespace="api.company.com/Services/Tester/2012/01">) ?

EDIT2: I found this link, but is pointing to another location which is not available anymore: http://social.msdn.microsoft.com/Forums/en/wcf/thread/66c19783-6675-4bd7-83c1-2140d00a943e . Could anyone help?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

ゞ花落谁相伴 2025-01-02 07:11:38

是的,经过一番阅读后……

微软建议使用命名空间来版本数据契约。请参阅最佳实践:数据合同版本控制

虽然在这些示例中名称已更改(通过附加“2”),但建议通过附加带有版本号或日期的新命名空间来更改命名空间而不是名称。例如,http://schemas.contoso.com/2005/05/21/PurchaseOrder 数据契约将更改为 http://schemas.contoso.com/2005/10/14/PurchaseOrder 数据协定.

命名空间可以在多个位置设置(ServiceContractAttribute、ServiceBehaviorAttribute、DataContractAttribute,请参阅 WCF 服务命名空间)。

在 WSDL 中拥有一致的名称空间并跟踪契约、行为或数据契约的更改似乎很重要。

Yes, after some reading ...

Microsoft recommends using the namespace to version data contracts. See Best Practices: Data Contract Versioning

Although in these examples names are changed (by appending a "2"), the recommendation is to change namespaces instead of names by appending new namespaces with a version number or a date. For example, the http://schemas.contoso.com/2005/05/21/PurchaseOrder data contract would change to the http://schemas.contoso.com/2005/10/14/PurchaseOrder data contract.

The namespace can be set in various places (ServiceContractAttribute, ServiceBehaviorAttribute, DataContractAttribute, see WCF service namespaces).

To have a consistent namespace in the WSDL and to keep track of changes to the contract, behavior or data contract it seems important.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文