开发者

Basic HTTP Binding isn't configured properly

开发者 https://www.devze.com 2023-02-09 08:40 出处:网络
i have configured a WCF service with wsHTTPBinding but even then i get the error Contract requires Session, but Binding \'BasicHttpBinding\' doesn\'t support it or isn\'t configured properly to sup

i have configured a WCF service with wsHTTPBinding but even then i get the error

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

here is the service contract definition

<ServiceContract(SessionMode:=SessionMode.Required)>
Public Interface IPrivateService

Here is the service implementation definition

<ServiceBehavior(InstanceContextMode:=InstanceContextMode.PerSession)>
Public Class PrivateService
    Implements IPrivateService

Here is the config settings

<services>
    <service behaviorConfiguration="behaviorAction" name="Viking.Service.PrivateService">
            <endpoint address="RequiredService" binding="wsHttpBinding" bindingConfiguration="bindingAction" contract="Viking.Service.IPrivateService">
              <identity>
                <dns value="localhost"/>
              </identity>
            </endpoint>
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
          </service>
</services>
<bindings>
          <wsHttpBinding>
            <binding name="bindingAction" transactionFlow="false" sendTimeout="00:30:00" receiveTimeout="00:30:00">
              <reliableSession enabled="true"/>
            </binding>
          </wsHttpBinding>
</bindings>

truly appreciate any ad开发者_运维知识库vise on the issue.


If you are using wcf 4.0 then open web.config/app.config and add following tag inside <system.serviceModel> tag.

  <protocolMapping>
  <add scheme="http" binding="wsHttpBinding"/>
</protocolMapping>
0

精彩评论

暂无评论...
验证码 换一张
取 消