title: Why does my Wcf Duplex service gets in faulted state after first call to the service?
body: <p>What I am trying to do is have a wcf duplex service that multiple clients register to. When a client calls the service, the other clients are notified of the call.</p>
  
  <p>Right now, I have a Silverlight app that calls a wcf duplex service. On the first call everything is working correctly including duplex communication. On the second call to the service I am getting a :</p>
  
  <pre><code>The communication object, System.ServiceModel.Channels.ClientPollingDuplexSessionChannel, cannot be used for communication because it is in the Faulted state.
  </code></pre>
  
  <p>My service has 2 different methods; RegisterClient and ReassignOwner. If I call the same method twice or both method once in any order I am still getting this error.</p>
  
  <p>After researching on the subject I thought it might be a timeout problem. I checked what the default timeout value was and it's 10 minutes. I do both calls within the span of 2-3 minutes tops. I have also increased the Inactivity timeout  and the Receive timeout to 4 hours just to be sure and I am still getting this problem.</p>
  
  <p>Next, I thought my service might be generating an exception which would cause the client to go in a faulted state. To test this, I have put try/catch statements in the 2 methods of my service and ran the program in debug mode. I did not catch any exception. I also tried commenting out all the code from those 2 methods (so no exception can be generated) and just calling those 2 empty methods and I still got the exception.</p>
  
  <p>By reading other related post here on SO, I decided to try WCF tracing. I enabled it in my web.config and set the switch value to Warning. I get 2 warnings:</p>
  
  <pre><code>Description Faulted System.ServiceModel.Channels.ServicePollingDuplexSessionChannel
  Description Faulted System.ServiceModel.Channels.ServiceChannel
  </code></pre>
  
  <p>Here is how my service is defined in the code behind .svc.cs file:</p>
  
  <pre><code>[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Single, AutomaticSessionShutdown = false)] 
  [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
  public class NotificationService : BaseService, INotificationDuplexService
  </code></pre>
  
  <p>In my service contract my methods both have the following attributes:</p>
  
  <pre><code>[OperationContract(AsyncPattern = true, IsOneWay = true,
                     Action = "http://www.abc.org/NotificationDuplex/INotificationDuplexService/MethodName")]
  </code></pre>
  
  <p>Both my methods are implemented in an async fashion with a Begin and an End method.</p>
  
  <p>Here is how I invoke my methods</p>
  
  <pre><code>base.InvokeAsync(this.onBeginRegisterClientDelegate, new object[] {
                      id}, this.onEndRegisterClientDelegate, this.onRegisterClientCompletedDelegate, userState);
  </code></pre>
  
  <p>Anybody know why this is happening or have any clue to how I could continue trying to solve this problem ?</p>