WCF 是将服务公开给 Oracle Service Bus 的好选择吗
我们公司有一个Oracle服务总线架构(OSB)。我的部门需要向此 OSB 公开少量服务,这些服务稍后将被不同部门和技术的不同应用程序使用。 我有 7-8 个应用程序,全部都是基于 Microsoft 的(VB6、C#、SQL Server)。 我的问题是 WCF 是否是开发我们基于数据的服务的好选择?它与 OSB 结合得很好吗?是否存在任何集成问题? 在这种情况下,最佳实践是什么以及应该使用哪种 wcf 传输协议?
Our company has an Oracle Service Bus Architecture(OSB). My department needs to expose few services to this OSB which will be later consumed by different applications across different departments and technologies.
I have 7-8 applications and all are Microsoft-based (VB6, C#, SQL Server).
My question is whether WCF is a good option to develop our data-based services? Does it integrate well with the OSB? Are there any integration issues?
What is the best practice and what transport protocol for wcf should be used in this scenario?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我参与过一些成功的项目,这些项目使用 SOAP/HTTP 作为传输协议,将 WCF 与 OSB 集成。
根据以前的经验,需要避免两个关键风险:
如果方法是 WCF 提供数据集成,OSB 提供访问和执行的中心点(以及可能的集成),那就太棒了。这是沙滩上的一条清晰的线。
I've been involved in successful projects that have integrated WCF with OSB, using SOAP/HTTP as the transport protocol.
From previous experience, two key risks to avoid:
If the approach is WCF to provide the data integration, and OSB to provide the central point of access and enforcement (along with integration possibly) then fantastic. That's a clear line in the sand.
我同意凯文的回应。据我所知,WCF 与 Microsoft 产品配合得很好,但与其他产品配合得不太好。如果您保持 WCF 服务实现相当简单,并将所有繁重的工作留给 OSB(例如安全、策略、寻址),那么您可能没问题。
需要注意的另一个陷阱是 WCF 似乎将 XML 类型绑定到本机 .NET 类型。虽然这对于大多数类型来说都是可以的,但让我们非常头痛的一件事是日期。在 XML 中,您可以使用 null 日期,但在 .NET 中,日期是基本类型而不是对象,因此当您尝试将其设置为 null 时,日期就会消失。您可以通过将它们处理为字符串(yuk)并在应用程序中进行转换来解决这个问题,或者我相信您也可以创建一个自定义绑定,您可以在其中将日期类型包装在 DateWrapper 对象中,以适应空值。
就我个人而言,我喜欢服务总线的模型只是在其他地方托管的实现的外观,因此从这个角度来看,我认为在 OSB 公开的服务背后使用什么技术并不重要。
在传输方面,如果您的数据服务是以非事务方式访问数据(例如检索客户详细信息),那么 SOAP/HTTP 就可以。如果您正在处理事务数据,可以考虑基于消息传递的传输(例如 JMS 或 MQ),因为根据经验,对 WS-ReliableMessaging 的支持尚未无处不在,也不是一致的。
希望有帮助。
I would agree with Kevin's response. From what I've seen, the WCF plays quite nicely with Microsoft products but not so well with others. If you keep your WCF service implementation fairly vanilla and leave all the heavy lifting to the OSB (e.g. security, policy, addressing) then you may be OK.
One other trap to be aware of is that WCF appears to bind XML types to native .NET types. While this is OK for most of the types, one thing that caused us lots of headaches was dates. In XML you can have a null date, but in .NET a date is a primitive type rather than an object, and so dies when you try making it null. You can either get around this by processing them as strings (yuk) and converting to/from in your application, or I believe you can also create a custom binding, where you could wrap the date type in a DateWrapper object, to cater for nulls.
Personally I like the model of the service bus being just a facade for an implementation hosted elsewhere, so from that perspective I don't think it matters what technology gets used behind the covers of the OSB-exposed service.
In terms of transport, if your data services are about accessing data in a non-transactional way (e.g. retrieve customer details) then SOAP/HTTP is fine. If you are dealing with transactional data, maybe consider a messaging-based transport like JMS or MQ, as from experience the support for WS-ReliableMessaging is not yet everywhere, or consistent.
Hope that helps.