简体   繁体   English

合同需要Session,但Binding'BasicHttpBinding'不支持它,或者没有正确配置以支持它

[英]Contract requires Session, but Binding 'BasicHttpBinding' doesn't support it or isn't configured properly to support it

When i'm using SessionMode = SessionMode.Required in servicecontract then i get this error 当我在servicecontract中使用SessionMode = SessionMode.Required ,我收到此错误

Contract requires Session, but Binding 'BasicHttpBinding' doesn't support it or isn't configured properly to support it. 合同需要Session,但Binding'BasicHttpBinding'不支持它,或者没有正确配置以支持它。

anyone tell me a solution? 有谁告诉我一个解决方案?

随着它的上市在这里 ,选择wsHttpBindingNetTcpBinding.WSHttpBinding结合。

This error message is seldom clear. 此错误消息很少清除。 Here the answer goes like this, basichttpbinding doesn't support session. 答案是这样的,basichttpbinding不支持会话。 So you have to use the below property if you want to use it. 因此,如果要使用它,则必须使用以下属性。 [ServiceContract(SessionMode = SessionMode.Allowed)] [ServiceContract(SessionMode = SessionMode.Allowed)]

This means, If you are trying to configure multiple bindings like basichttp, wshttp, net.tcp, WCF will automatically enable session for other than basichttp binding. 这意味着,如果您尝试配置多个绑定,如basichttp,wshttp,net.tcp,WCF将自动启用除basichttp绑定之外的会话。 so if you put SessionMode.Required instead of Allowed, then you are forced not to use basichttpbinding. 因此,如果您使用SessionMode.Required而不是Allowed,那么您将被迫不使用basichttpbinding。

That said, solving this issue usually would require something like this: 也就是说,解决这个问题通常需要这样的事情:

<system.serviceModel>
    <protocolMapping>
      <add scheme="http" binding="wsHttpBinding" bindingConfiguration="wsHttpBindingConfiguration" />
    </protocolMapping>
    <bindings>
      <wsHttpBinding>
        <binding name="wsHttpBindingConfiguration" transactionFlow="true" />
      </wsHttpBinding>
      .......

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 合同需要Duplex,但Binding'BasicHttpBinding'不支持它,或者没有正确配置以支持它 - Contract requires Duplex, but Binding 'BasicHttpBinding' doesn't support it or isn't configured properly to support it WCF netTcpBinding 问题:合同需要双工,但绑定“BasicHttpBinding”不支持或未正确配置以支持它 - WCF netTcpBinding issue: Contract requires Duplex, but Binding 'BasicHttpBinding' doesn't support it or isn't configured properly to support it 合同要求使用双工,但是绑定“ BasicHttpBinding”不支持它,或者没有正确配置为支持它 - Contract requires Duplex, but Binding 'BasicHttpBinding' doesn't support it or isn't configured properly to support it 获取错误:合同需要Duplex,但Binding&#39;BasicHttpBinding&#39;不支持它,或者没有正确配置以支持它 - Getting an error: Contract requires Duplex, but Binding 'BasicHttpBinding' doesn't support it or isn't configured properly to support it 无法添加服务器引用:合同需要双工,但绑定“BasicHttpBinding”不支持或未正确配置以支持它 - Cannot add server reference: Contract requires Duplex, but Binding 'BasicHttpBinding' doesn't support it or isn't configured properly to support it 合同需要会话,但绑定“WSHttpBinding”不支持它或未正确配置以支持它 - Contract requires Session, but Binding ‘WSHttpBinding’ doesn’t support it or isn’t configured properly to support it Contract需要Session,但是绑定&#39;WSHttpBinding&#39;不支持它。 带有TransportWithMessageCredential的404 - Contract requires Session, but Binding 'WSHttpBinding' doesn't support it; 404 with TransportWithMessageCredential 未正确配置基本HTTP绑定 - Basic HTTP Binding isn't configured properly 绑定webHttpBinding不支持Session? - binding webHttpBinding not support Session? basicHttpBinding不使用自定义ServiceCredentials - basicHttpBinding doesn't use custom ServiceCredentials
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM