相关疑难解决方法(0)

如何使用wsHttpBidning和仅传输安全性启用WCF会话

我目前使用basicHttpBindings和SSL启用了WCF服务.但现在我需要启用wcf会话(而不是asp会话)所以我将服务转移到wsHttpBidnings但是会话未启用

我已经设定

[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)]
Run Code Online (Sandbox Code Playgroud)

但是当我设定的时候

SessionMode=SessionMode.Required
Run Code Online (Sandbox Code Playgroud)

在服务合同上,它说

合同需要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>
Run Code Online (Sandbox Code Playgroud)

请在这件事上给予我帮助

.net wcf wshttpbinding wcf-security wcf-sessions

6
推荐指数
1
解决办法
2万
查看次数

标签 统计

.net ×1

wcf ×1

wcf-security ×1

wcf-sessions ×1

wshttpbinding ×1