如何启用WCF会议与wsHttpBidning与交通运输仅安全 [英] how to enable WCF Session with wsHttpBidning with Transport only Security

查看:234
本文介绍了如何启用WCF会议与wsHttpBidning与交通运输仅安全的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前部署basicHttpBindings和SSL WCF服务启用。但现在我需要启用WCF会话(不是ASP会话),所以我感动的服务wsHttpBidnings但未启用会话

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

我已经设置

[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)]

但是,当我设置

But when i set

SessionMode=SessionMode.Required

在服务合同,它说

合同需要会话,但绑定   WsHttpBinding的不支持或   未正确配置为支持   吧。

Contract requires Session, but Binding 'WSHttpBinding' doesn't support it or isn't configured properly to support it.

以下是WsHttpBinding的定义

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>

请帮我这个

推荐答案

如果你想会与的wsHttpBinding,你必须使用任何可靠的消息,或安全会话。

If you want "sessions" with wsHttpBinding, you have to use either reliable messaging, or the security sessions.

要启用的wsHttpBinding会话之前,需要可靠的消息,而对于这一点,你需要更改设置可靠的会话(看起来像这样的标记&LT;的ReliableSession /&GT; )启用 - 让您的新的配置是这样的:

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:

<wsHttpBinding>
    <binding name="wsHttpBinding">
      <readerQuotas maxStringContentLength="10240" />
      <reliableSession enabled="true" />
      <security mode="Transport">
        <transport clientCredentialType="None">
          <extendedProtectionPolicy policyEnforcement="Never" />
        </transport>
      </security>
    </binding>
  </wsHttpBinding>

这篇关于如何启用WCF会议与wsHttpBidning与交通运输仅安全的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆