如何使用仅传输安全性的 wsHttpBidning 启用 WCF 会话
我当前部署了一个 WCF 服务,并启用了 basicHttpBindings 和 SSL。但现在我需要启用 wcf 会话(不是 asp 会话),所以我将服务移至 wsHttpBidnings 但会话未启用,
我已经设置了
[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)]
但是当我设置
SessionMode=SessionMode.Required
服务合同时它说
合约需要Session,但是Binding “WSHttpBinding”不支持它或 未正确配置以支持 它。
以下是 WSHttpBinding 的定义
<wsHttpBinding>
<binding name="wsHttpBinding">
<readerQuotas maxStringContentLength="10240" />
<reliableSession enabled="false" />
<security mode="Transport">
<transport clientCredentialType="None">
<extendedProtectionPolicy policyEnforcement="Never" />
</transport>
</security>
</binding>
</wsHttpBinding>
请帮我解决这个问题
I have a WCF Service currently deployed with basicHttpBindings and SSL enabled. But now i need to enable wcf sessions(not asp sessions) so i moved service to wsHttpBidnings but sessions are not enabled
I have set
[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)]
But when i set
SessionMode=SessionMode.Required
on service contract it says
Contract requires Session, but Binding
'WSHttpBinding' doesn't support it or
isn't configured properly to support
it.
following is the definition of WSHttpBinding
<wsHttpBinding>
<binding name="wsHttpBinding">
<readerQuotas maxStringContentLength="10240" />
<reliableSession enabled="false" />
<security mode="Transport">
<transport clientCredentialType="None">
<extendedProtectionPolicy policyEnforcement="Never" />
</transport>
</security>
</binding>
</wsHttpBinding>
please help me with this
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您想要使用 wsHttpBinding 进行“会话”,则必须使用可靠消息传递或安全会话。
要在 wsHttpBinding 上启用会话,您需要可靠的消息传递,为此,您需要更改要启用的可靠会话的设置(类似于
的标记) - 因此你的新配置将如下所示:If you want "sessions" with wsHttpBinding, you have to use either reliable messaging, or the security sessions.
To enable sessions on wsHttpBinding, you need reliable messaging, and for that, you need to change the setting for reliable session (the tag that looks like this
<reliableSession/>
) to be enabled - so your new config would look like this:好的
那么“需要 HTTPs 而不是 HTTP”错误将被修复。well make
<security mode="None">
then the "Https expected instead of HTTP error will be fixed.转到您的 IIS 主机并右键单击您的应用程序,然后选择 MangeApplication 和高级设置,然后在启用的协议中添加“wsHttpBinding”。
go to your IIS host and Right Click on your Application and choose MangeApplication and Advanced Settings and in Enabled Protocols add "wsHttpBinding".