0

i want to enable (SessionMode=SessionMode.Required) in my service, so when i have enabled it then test the service using WCF Client Test it raise the following error:

The message could not be processed. This is most likely because the action 'http://schemas.xmlsoap.org/ws/2004/09/transfer/Get' is incorrect or because the message contains an invalid or expired security context token or because there is a mismatch between bindings. The security context token would be invalid if the service aborted the channel due to inactivity. To prevent the service from aborting idle sessions prematurely increase the Receive timeout on the service endpoint's binding.HTTP GET Error

URI: http://localhost:7645/PublisherService.svc    

The HTML document does not contain Web service discovery information.

<system.serviceModel>

    <bindings>
        <basicHttpBinding>
            <binding name="myBasicBinding"  maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" closeTimeout="00:01:00" openTimeout="00:01:00" sendTimeout="00:01:00" receiveTimeout="00:01:00">
                <readerQuotas maxDepth="128" maxStringContentLength="8388608" maxArrayLength="2147483647" maxBytesPerRead="4096" maxNameTableCharCount="2147483647"/>
            </binding>

        </basicHttpBinding>

   <!--enable WSHTTPBinding session-->
  <wsHttpBinding>
    <binding name="bindingAction" transactionFlow="false" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"  sendTimeout="00:01:00"   receiveTimeout="00:01:00" closeTimeout="00:01:00" openTimeout="00:01:00">
      <readerQuotas maxDepth="128" maxStringContentLength="8388608" maxArrayLength="2147483647" maxBytesPerRead="4096" maxNameTableCharCount="2147483647"/>
      <reliableSession enabled="true"/>
      <security mode="Transport">
        <message establishSecurityContext="false" clientCredentialType="IssuedToken"/>
      </security>  
    </binding>
  </wsHttpBinding>

</bindings>

 <protocolMapping>
  <add scheme="http" binding="wsHttpBinding"/>
</protocolMapping>
<!-- \\\\\\\\\\\\\\\\\\\\\\\\\\\ -->
<services>
  <service name="AllChatService.PublisherService"  behaviorConfiguration="metadataSupport">    
    <host>
      <baseAddresses>
        <add baseAddress ="http://localhost:7645/"/>
      </baseAddresses>
    </host>
    <endpoint contract="AllChatService.PublisherService" binding="wsHttpBinding" address=""/>
    <!--Enable Meta Data Publishing-->
    <endpoint address="mex"  binding="mexHttpBinding"  contract="IMetadataExchange"/>
  </service>
</services>

 <behaviors>
    <serviceBehaviors>
    <behavior name="metadataSupport">
      <serviceDebug includeExceptionDetailInFaults="False" />

   <!--Enable WSDL Data Binding-->
      <serviceMetadata httpGetEnabled="true" httpGetUrl=""/>
    </behavior>
  </serviceBehaviors>


    </behaviors>

<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
</system.serviceModel>




[ServiceBehaviorAttribute(InstanceContextMode = InstanceContextMode.PerCall)]
public class PublisherService : IPublisher
{
}

[ServiceContract(SessionMode = SessionMode.Required)]
public interface IPublisher
{
}

So can any one help me to solve this problem.

user2431952
  • 17
  • 1
  • 5

1 Answers1

0

remove the line

<security mode="Transport">

from your web.config file. because Transport seems to require HTTPS to encrypt credentials.

Rayhan.iit.du
  • 279
  • 1
  • 4