作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我目前部署了一个 WCF 服务,启用了 basicHttpBindings 和 SSL。但是现在我需要启用 wcf session (不是 asp session ),所以我将服务移至 wsHttpBidnings 但未启用 session
我已经设定
[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)]
SessionMode=SessionMode.Required
Contract requires Session, but Binding 'WSHttpBinding' doesn't support it or isn't configured properly to support it.
<wsHttpBinding>
<binding name="wsHttpBinding">
<readerQuotas maxStringContentLength="10240" />
<reliableSession enabled="false" />
<security mode="Transport">
<transport clientCredentialType="None">
<extendedProtectionPolicy policyEnforcement="Never" />
</transport>
</security>
</binding>
</wsHttpBinding>
最佳答案
如果您想使用 wsHttpBinding 进行“ session ”,则必须使用可靠消息传递或安全 session 。
要在 wsHttpBinding 上启用 session ,您需要可靠的消息传递,为此,您需要更改要启用的可靠 session 的设置(看起来像 <reliableSession/>
的标签) - 因此您的新配置将如下所示:
<wsHttpBinding>
<binding name="wsHttpBinding">
<readerQuotas maxStringContentLength="10240" />
<reliableSession enabled="true" />
<security mode="Transport">
<transport clientCredentialType="None">
<extendedProtectionPolicy policyEnforcement="Never" />
</transport>
</security>
</binding>
</wsHttpBinding>
关于.net - 如何使用 wsHttpBidning 启用 WCF Session with only Transport Security,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2650738/
我目前部署了一个 WCF 服务,启用了 basicHttpBindings 和 SSL。但是现在我需要启用 wcf session (不是 asp session ),所以我将服务移至 wsHttpB
我是一名优秀的程序员,十分优秀!