title: Can't call my service method
body: <p>I'm getting this error:</p>
  
  <blockquote>
    <p>The communication object,
    System.ServiceModel.ChannelFactory`1[FxCurveService.IFxCurveService],
    cannot be used for communication because it is in the Faulted state.</p>
  </blockquote>
  
  <p>When I call this code:</p>
  
  <pre><code>using (var client = new WCFServiceChannelFactory&lt;IFxCurveService&gt;(new Uri("http://ksqcoreapp64int:5025/")))
                  {
                      guid = client.Call(svc =&gt; svc.ReserveSnapshot(fxCurveKey));
                      DiscountFactorNew[] dfs = client.Call(svc =&gt; svc.GetDiscountFactors(guid, dates, from));
                      Assert.IsTrue(guid != null);
                  }
  </code></pre>
  
  <p>It errors here - <code>client.Call(svc =&gt; svc.ReserveSnapshot(fxCurveKey));</code></p>
  
  <p>I have no idea why it is doing this. I am passing the right parameters, inputting the correct address for the service, what else should I be checking here?</p>
  
  <p>Btw, <code>WCFServiceChannelFactory</code> is our own class we use to take care of making service calls. Outline here:</p>
  
  <pre><code>public class WCFServiceChannelFactory&lt;T&gt; : IDisposable
      {
          public WCFServiceChannelFactory();
          public WCFServiceChannelFactory(Uri uri);
  
          public T Channel { get; }
          public System.ServiceModel.ChannelFactory&lt;T&gt; ChannelFactory { get; }
          public Type ChannelType { get; }
  
          public void Call(Action&lt;T&gt; f);
          public R Call&lt;R&gt;(Func&lt;T, R&gt; f);
          public void Dispose();
      }
  </code></pre>
  
  <p>The thing is, the problem is not with this, as this is working in the same exact fashion in every other project but this one. Basically, I have to pass the <code>Uri</code> directly in mine, where as others derive it from a .config file in the project, which I was unable to do here. That's the only difference.</p>
  
  <p>Thanks.</p>