WCF 的推荐协议\绑定类型
我正在开发将由许多不同平台(如 Java、PHP、C 或 C++ 等)使用的服务。我想知道我应该为这些类型的服务使用什么协议或绑定类型。应该有一个可以被所有类型或大多数技术使用的通用协议。我使用 BasicHTTPBindig 来实现此目的,但这不支持客户端应用程序上的事务。支持的绑定类型有 wsHttpBinding 等。我可以使用 WCF 提供的事务支持类型,但我不知道其他技术是否支持它们。
所以问题是支持大多数主要技术来使用 WCF 服务的最佳推荐协议或绑定类型是什么。
任何形式的帮助/建议将不胜感激。
I am developing services which will be consumed by many different platforms like Java,PHP,C or C++ etc. I want to know what protocol or binding type should I use for these kind of services. There should be a common protocol which can be used by all kind of technologies or most of them. I used BasicHTTPBindig for this purpose but this does not support transactions on client application. The supported Binding types are wsHttpBinding and others. I can use transactions supported types which are available with WCF but I don't know other technologies support them or not.
So the Question is What is the best Recommended Protocol or Binding type which support most of major technologies to consume WCF services.
Any kind of help/suggestion will be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我希望客户端事务指的是分布式事务(从客户端开始到服务器的流动事务)。这是相当具有挑战性的,因为对分布式事务的互操作支持需要平台实现 WS-AtomicTransaction 和 WS-Coordinator 协议。简而言之,几乎没有服务堆栈提供这些协议(除了 WCF 和几个 Java 堆栈)。因此,您可能会使用 .NET、Java、C/C++ 来实现此功能(但配置并不容易),但您将很难在 PHP、Python 等中使用它。移动设备也不支持这些协议设备。
分布式事务被视为内部服务器到服务器功能。因此,如果你要提供公共服务,你应该改变你的设计。如果您打算让公共服务/服务由客户端应用程序(而不是服务器)使用,那么您应该选择基本的 HTTP 绑定(或创建 REST 服务)以获得最大的互操作性。
I expect that by client side transaction you mean distributed transaction (flowing transaction started at client to server). This is quite challenging because interoperable support for distributed transactions requires WS-AtomicTransaction and WS-Coordinator protocols to be implemented by the platform. In short almost none service stack provides these protocols (except WCF and several Java stacks). So you will probably make this work with .NET, Java, C/C++ (but the configuration will not be easy) but you will have a hard time to use it in PHP, Python, etc. These protocols are also not supported on mobile devices.
Distributed transactions are considered as internal server to server feature. So if you are going to make public service you should change your design. If you are going to make public service / service consumed by client applications (not servers) then you should choose basic HTTP binding (or create REST service) for maximal interoperability.
我有一段时间没有看过 WCF(例如,我不知道 .Net 4.0 中发生了什么变化(如果有的话))...但是如果您想与非 MS/非 WCF 客户端交互,您可以过去需要 WSE(Web 服务增强)。
这是一个很好的链接:
http://msdn.microsoft.com/en-us/库/ee958158.aspx
I haven't looked at WCF for awhile (I don't know what - if anything - has changed in .Net 4.0, for example) ... but if you wanted to interface to non-MS/non-WCF clients, you used to need WSE (Web Services Enhancements).
Here's a good link:
http://msdn.microsoft.com/en-us/library/ee958158.aspx