title: WCF Test Client error: Failed to Invoke the service
body: <p>I'm getting an error when trying to use the WCF Test Client with my WCF service. Here is the service code:</p>
  
  <pre><code>[ServiceContract]
  public interface IEmployeeService
  {
      [OperationContract(Name = "GetEmployee")]
      [WebGet(RequestFormat = WebMessageFormat.Xml,
          UriTemplate = "/Employees/{employeeNumber}")]
      Employee GetEmployee(string employeeNumber);
  }
  
  public Employee GetEmployee(string employeeNumber)
  {
      var employeeNumberValue = Convert.ToInt32(employeeNumber);
      var employee = DataProvider.GetEmployee(employeeNumberValue);
      return employee;
  }
  
  &lt;system.serviceModel&gt;
      &lt;services&gt;
          &lt;service name="Employees.Services.EmployeeService"
                   behaviorConfiguration="metaBehavior"&gt;
              &lt;endpoint address=""
                        behaviorConfiguration="webHttp"
                        binding="webHttpBinding"
                        contract="Employees.Services.IEmployeeService"&gt;
              &lt;/endpoint&gt;
              &lt;endpoint address="mex"
                        binding="mexHttpBinding"
                        contract="IMetadataExchange"&gt;
              &lt;/endpoint&gt;
          &lt;/service&gt;
      &lt;/services&gt;
      &lt;behaviors&gt;
          &lt;endpointBehaviors&gt;
              &lt;behavior name="webHttp"&gt;
                  &lt;webHttp/&gt;
              &lt;/behavior&gt;
          &lt;/endpointBehaviors&gt;
          &lt;serviceBehaviors&gt;
              &lt;behavior name="metaBehavior"&gt;
                  &lt;serviceMetadata httpGetEnabled="true" /&gt;
              &lt;/behavior&gt;
          &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
  &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>I am able to connect to the service using the WCF Test Client, but when I try to invoke GetEmployee(employeeNumber) I get the following error:</p>
  
  <p><em>Failed to invoke the service. Possible causes: The service is offline or inaccessible; the client-side configuration does not match the proxy; the existing proxy is invalid. Refer to the stack trace for more detail. You can try to recover by starting a new proxy, restoring to default configuration, or refreshing the service.</em></p>
  
  <p>I was able to successfully call this service by sending a request from the browser.</p>
  
  <p>Any idea why I can't use the WCF Test Client?</p>