开发者

Basic HTTP Binding isn't configured properly

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜