WCF 服务向后兼容性检查

发布于 2024-07-15 12:19:36 字数 419 浏览 6 评论 0原文

我刚刚编写了 WCF Web 服务的新版本,我想确保我没有对服务和数据契约进行任何重大更改。

回想一下我作为 VB6 Com Api 开发人员的日子,我记得在编译时指定组件的先前发行版本,并让编译器检查是否保持了二进制兼容性是多么容易。

我设想了类似的东西(希望)称为“合同兼容性”检查。 它将使用元数据执行与 VB6 开发环境类似的检查。 这可以作为执行实用程序的单独构建步骤来完成。

我准备承认不存在这样的实用程序。 如果是这样的话,有人对实现这一目标的算法有什么想法吗?

  1. 从当前实时服务版本中检索
  2. 元数据 从新服务版本中检索元数据
  3. 检查服务合同和每个数据合同的兼容性。 仅报告重大变更。

第 3 步看起来很复杂,但肯定可以自动化......

I have just written a new version of a WCF web service and I want to make sure that I have not made any breaking changes with regard to Service and Data contracts.

Thinking back to my days as a VB6 Com Api developer I recall how easy it was to specify the previous release version of the component at compile time, and have the compiler check that binary compatibility is being maintained.

I envisage something similar called (hopefully) a “Contract Compatibility” check. It would use the metadata to perform a similar check to the one that the VB6 dev env did. This could be done as a separate build step that would execute a utility.

I am prepared to accept that there exists no such utility out there. If that is the case, does anyone have any ideas about how the algorithm to achieve this would look?

  1. Retrieve metadata from current live service version
  2. Retrieve meta data from new service version
  3. Check Service Contract and each Data Contract for compatibility. Only reporting breaking changes.

Step 3 seems like it would be complex but certainly automatable...

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

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

发布评论

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

评论(4

原野 2024-07-22 12:19:36

这些情况可以通过集成/回归测试来解决。 您为初始版本编写集成测试,将服务修改为新版本后,使用旧客户端再次运行集成测试。 如果他们成功了,你就不会破坏任何东西。 如果失败,您可以准确地看到是什么调用导致了问题。

These situations are solved by integration/regression testing. You write integration tests for initial version and after modifying service to new version you run integration tests again using old client. If they success you didn't break anything. If they fail you see exactly what calls caused problems.

江南烟雨〆相思醉 2024-07-22 12:19:36

Andy 不存在这样的东西,但是如果你启动并运行了一些东西,其中你有 2 个 DLL(一个旧的和一个新的),那么你可以使用类似 BitDiffer 的东西来比较它们。

Codeplex 上有一个项目可以帮助发布 WCF,但我不记得它叫什么了,抱歉。

祝你好运,

-基思

Nothing like that exists Andy but if you get something up and running whereby you have 2 DLLs (one old and one new), you could then use something like BitDiffer to compare them.

There was a project on Codeplex that helped with WCF releases, but I can't remember what it is called, sorry.

Good luck,

-Keith

寄与心 2024-07-22 12:19:36

尝试使用旧接口合约的 "Codeplex WCF 负载测试" 生成单元测试,并在新接口合约上运行它们:

此工具采用 WCF 跟踪文件和 WCF 客户端代理或 WCF 接口协定,并生成 C# 单元测试,该测试重播在跟踪文件中找到的相同调用序列。 然后可以使用单元测试对目标进行负载测试。

Try to generate unit tests using "Codeplex WCF Load Test" for old interface contract and run them on a new one:

This tool takes a WCF trace file and a WCF client proxy, or a WCF interface contract, and generates a C# unit test that replays the same sequence of calls found in the trace file. The unit test can then be used to load-test the target.

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