wshttpbinding 的 SessionMode.NotAllowed 与 maxConcurrentSessions
serviceThrotdling 的服务属性 SessionMode.NotAllowed 和 maxConcurrentSessions 可以与 wshttpbinding 同时使用。
这是否意味着它们可能指的是两个不同的会话概念?
例如 SessionMode.NotAllowed = 无状态服务。
最大并发会话数 = 最大并发会话数并发(不同?)安全谈判。
编辑:
来自这个答案对另一个问题 我理解“WCF 将检查 app.config [maxConcurrentSessions] 是否与属性 [SessionMode.NotAllowed] 一致,如果它们一致,则拒绝启动服务不一致”。
当声明 SessionMode.NotAllowed 并且这会禁用会话时,WCF 是否应该因为与 maxConcurrentSessions 的配置相矛盾而拒绝启动服务?
The service attribute SessionMode.NotAllowed and maxConcurrentSessions of serviceThrottling can be used simultaneously with wshttpbinding.
Does this mean that they perhaps refer to two different concepts of session?
E.g.
SessionMode.NotAllowed = stateless service.
maxConcurrentSessions = max. concurrent (different?) security negotiations.
EDIT:
From this answer to another question I have understood that "WCF will check that app.config [maxConcurrentSessions] is consistent with attributes [SessionMode.NotAllowed] and refuse to start the service if they are not consistent".
When SessionMode.NotAllowed is declared and this disables the use of sessions, shouldn't WCF then refuse to start the service because of the contradicting configuration with maxConcurrentSessions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
SessionMode.NoAllowed 表示合约必须以无状态方式实现。
对于 NetTcp,这将阻止服务以其固有的会话方式启动,对于 WSHttpBinding,它将抑制会话。
如果您使用 SessionMode.NotAllowed,则 maxConcurrentSessions 将不起作用,因为不会有任何 会话。限制
WSHttpBinding 的会话使用 SecureConversation 来支持其会话概念(如果可用)。如果不可用,它将使用可靠的消息传递(如果可用)。如果两者都不可用,则无法支持会话
我写了
更新响应编辑
安全对话和会话不一样 事物。无论您是否有会话,都可以使用安全对话。 WSHttpBinding 支持会话的一种方式是使用安全会话协商来定义会话。但是,如果您说 SessionMode.NotAllowed,那么 WCF 将根本没有 sessionID 并且不支持会话 - 这并不意味着它不会使用安全会话
maxConcurrentSessions 限制并发会话的最大数量。如果关闭会话,则会话数将为 0,因此始终小于最大会话数
SessionMode.NoAllowed says that the contract must be implemented in a stateless way
For NetTcp this would prevent the service starting as its inherently sessionful, for WSHttpBinding it will suppress the session
maxConcurrentSessions will have no effect if you use SessionMode.NotAllowed as there will be no sessions to throttle
WSHttpBinding uses SecureConversation to support its concept of session if its available. If its not available it will use reliable messaging if its available. If neither are available it cannot support session
I wrote a blog article about this stuff a while back
Update in Response to Edit
Secure conversation and Sessions are not the same thing. Secure Conversation can be used whether or not you have sessions. One way WSHttpBinding supports session is to the use the negotiation of secure conversation to define the session. However, if you say SessionMode.NotAllowed then WCF will simply not have a sessionID and not support session - it doesn't mean it won't use secure conversation
maxConcurrentSessions limits the maximum number of concurrent sessions. If you turn off session then the number of sessions will be 0 and so will always be less than the maximum