WCF ReliableMessaging - 使用 SessionId 连接到现有的 OperationContext
我目前正在从事 WCF - WSIT 集成任务。我将 WS-ReliableMessaging 与 WCF 和 ws2007HttpBinding 一起使用。
可靠的会话设置正确,我正在使用 InstanceContextMode.PerSession,并且我的服务实例在一分钟不活动后被终止。
我唯一担心的是,我不确定如何创建使用现有 OperationContext 的 SessionId 初始化的 WCF 代理。 Visual Studio 生成的代理似乎不接受 SessionId 作为构造函数等。
我希望能够使用 SessionId 重新连接到活动服务,即使我的代理客户端已终止并且我必须重新创建它。
I am currently working on a WCF - WSIT integration task. I am using WS-ReliableMessaging with WCF and ws2007HttpBinding.
Reliable session is set up correctly, I am using InstanceContextMode.PerSession and my service instance is killed off after one minute inactivity.
My only concern is that I am not sure how I can create a WCF proxy initialized with an existing OperationContext's SessionId. The Visual Studio generated proxy doesn't seem to accept a SessionId as a constructor, etc.
I would like to be able to reconnect to the active service using the SessionId even if my proxy client died and I had to recreate it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
据我所知,只有客户端和服务器都处于活动状态,WCF 中的可靠会话才会存在。可靠会话在通道级别上实现为 WS-ReliableMassaging,提供传输级别的可靠性 - 这意味着它可以处理丢失的消息、顺序传递、重新发送消息等。 = 可靠性只是为了克服不可靠的传输协议(如 HTTP)。
对于任何参与者都可能“死亡”或离线的情况,您必须使用消息传递(MS 世界中的 MSMQ)。当与 Java 世界集成时,您可能需要其他基于 JMS 的消息传递平台。
As I know reliable session in WCF lives only if both client and server are alive. Reliable session is on channel level implemented as WS-ReliableMassaging wich offers transport level reliablity - it means it can handle lost messages, in order delivery, resending messages etc. = reliability is only to overcome unreliable transport protocols like HTTP.
For scenarios where any participant can "die" or go offline you have to use messaging (MSMQ in MS world). When integrating with Java world you will probably need other messaging platform based on JMS.
您可以使用持久服务
http://www.wcftutorial.net/How- to-Create-Durable-Service.aspx
http://blogs.microsoft.co.il/blogs/egady/archive/2008/01/05/wcf-3-5-durable-services.aspx
you can use durable service
http://www.wcftutorial.net/How-to-Create-Durable-Service.aspx
http://blogs.microsoft.co.il/blogs/egady/archive/2008/01/05/wcf-3-5-durable-services.aspx