我目前使用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)
请在这件事上给予我帮助