代码之家  ›  专栏  ›  技术社区  ›  Mubashar

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

  •  6
  • Mubashar  · 技术社区  · 16 年前

    我目前部署了一个WCF服务,其中启用了basicHttpBindings和SSL。但现在我需要启用wcf会话(而不是asp会话),所以我将服务移动到WSHttpBidings,但会话未启用

    我已经准备好了

    [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)]
    

    SessionMode=SessionMode.Required
    

    服务合同上写着

    “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>
    

    请帮我做这个

    3 回复  |  直到 14 年前
        1
  •  8
  •   marc_s MisterSmith    16 年前

    如果希望使用wsHttpBinding进行“会话”,则必须使用可靠的消息传递或安全会话。

    <reliableSession/> )要启用-您的新配置如下所示:

    <wsHttpBinding>
        <binding name="wsHttpBinding">
          <readerQuotas maxStringContentLength="10240" />
          <reliableSession enabled="true" />
          <security mode="Transport">
            <transport clientCredentialType="None">
              <extendedProtectionPolicy policyEnforcement="Never" />
            </transport>
          </security>
        </binding>
      </wsHttpBinding>
    
        2
  •  -1
  •   user1312242    14 年前

    <security mode="None"> 然后将修复“Https”而不是HTTP错误。

        3
  •  -1
  •   Abdallah Eltarawy    13 年前

    转到IIS主机,右键单击应用程序并选择MangeApplication and Advanced Settings,然后在启用的协议中添加“wsHttpBinding”。

    推荐文章