title: Why is the WCF Client timeout ignored
body: <p>I have a WCF client with the following piece of code written:</p>
  
  <pre><code>MyClient myClient = new MyClient();
  
  string id = Guid.NewGuid();
  
  string result = myClient.Foo(id);
  
  Console.WriteLine(result);
  </code></pre>
  
  <p>This works, but I want to add a time limit for the service call, so an exception will be thrown if the operation takes too long. I tried adding the timeout in the config file at the binding element like so:</p>
  
  <pre><code>&lt;basicHttpBinding&gt;
     &lt;binding 
         receiveTimeout="00:00:05"
         sendTimeout="00:00:05"
     &lt;/binding&gt;
  &lt;/basicHttpBinding&gt;
  </code></pre>
  
  <p>This doesn't seem to work sadly.</p>
  
  <p>I also tried setting it manually in the code file like so:</p>
  
  <pre><code>MyClient myClient = new MyClient();
  
  myClient.Endpoint.Binding = new BasicHttpBinding()
  {
      SendTimeout = new TimeSpan(0, 0, 5),
      ReceiveTimeout = new TimeSpan(0, 0, 5)
  };
  
  string id = Guid.NewGuid();
  
  string result = myClient.Foo(id);
  
  Console.WriteLine(result);
  </code></pre>
  
  <p>But again, it doesn't seem to work.</p>
  
  <p>I tested it with a really slow service, and after 20 minutes it finally returned with the (correct) answer, but a timeout exception was not thrown.</p>
  
  <p>Is it possible that the WCF service I am trying to reach is somehow blocking timeouts?</p>