title: WCF inactivity timeout
body: <p>I have created a very simple WCF service, hosted on windows service, closely following the example on MSDN here: <a href="http://msdn.microsoft.com/en-us/library/ff649818.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ff649818.aspx</a></p>
  
  <p>If I make a 2nd call to my service > 10 mins after my first call, I'll get a inactivity timeout error. I understand that this is the default setting of the WCF client.</p>
  
  <p>However, when I change my app.config from </p>
  
  <pre><code> &lt;reliableSession ordered="true" inactivityTimeout="00:10:00"
                     enabled="false" /&gt;
  </code></pre>
  
  <p>to </p>
  
  <pre><code> &lt;reliableSession ordered="true" inactivityTimeout="infinite"
                      enabled="true" /&gt;
  </code></pre>
  
  <p>I get this error when I try to make a call:</p>
  
  <blockquote>
    <p><em>The message with Action
    'http://schemas.xmlsoap.org/ws/2005/02/rm/CreateSequence' cannot be
    processed at the receiver, due to a ContractFilter mismatch at the
    EndpointDispatcher. This may be because of either a contract mismatch
    (mismatched Actions between sender and receiver) or a binding/security
    mismatch between the sender and the receiver.  Check that sender and
    receiver have the same contract and the same binding (including
    security requirements, e.g. Message, Transport, None).</em></p>
  </blockquote>
  
  <p>This is how my WCF config file look like on the windows service.</p>
  
  <pre><code>  &lt;system.serviceModel&gt;
  &lt;services&gt;
    &lt;service name="Asis.IBSS.Milestone.WCFService.ServiceImplementation.VideoService"&gt;
      &lt;endpoint address="" binding="netTcpBinding" bindingConfiguration="" contract="Asis.IBSS.Milestone.WCFService.ServiceContract.IVideoService"&gt;
        &lt;identity&gt;
          &lt;dns value="localhost"/&gt;
        &lt;/identity&gt;
      &lt;/endpoint&gt;
      &lt;endpoint address="mex" binding="mexTcpBinding" bindingConfiguration="" contract="IMetadataExchange"/&gt;
      &lt;host&gt;
        &lt;baseAddresses&gt;
          &lt;add baseAddress="net.tcp://localhost:8555/MilestoneService"/&gt;
        &lt;/baseAddresses&gt;
      &lt;/host&gt;
    &lt;/service&gt;
  &lt;/services&gt;
  &lt;behaviors&gt;
    &lt;serviceBehaviors&gt;
      &lt;behavior name=""&gt;
        &lt;serviceMetadata httpGetEnabled="false"/&gt;
        &lt;serviceDebug includeExceptionDetailInFaults="false"/&gt;
      &lt;/behavior&gt;
    &lt;/serviceBehaviors&gt;
  &lt;/behaviors&gt;
  </code></pre>
  
  <p></p>
  
  <p>My question would be, how do I set the inactivityTimeout to inifinte, and circumvent the errors I'm getting?</p>