title: Why can't temp directory be found when calling a wcf service and receiving a POCO response?
body: <p>I am trying to call an existing WCF service. I have generated (and updated many times) the service reference. This service has two methods. One method returns a string and the other returns a large POCO. When I call the string method using my local IIS (not IIS Express) with an app pool setup for the service account that I intend to use in DEV, I get a valid response. When I call the other method I receive this error.</p>
  
  <blockquote>
    <p>An exception of type 'System.ServiceModel.FaultException`1' occurred in mscorlib.dll but was  not handled in user code
    Additional information: Could not find a part of the path 'C:\Windows\TEMP\1c4e1c24-69a4-4cdd-bca8-73f6b2415d48'.</p>
  </blockquote>
  
  <p>When I call that same method using the WCFTestClient.exe with the same input parameter I receive a successful reply.</p>
  
  <p>My temp directory has modify access for the Everyone group.</p>
  
  <p>This is the code that I'm using to call the service.</p>
  
  <pre><code>public class BackupRetrievalServiceClient : ClientBase&lt;IBackupRetrievalService&gt;, IBackupRetrievalService
  {
      public BackupRetrievalServiceClient()
      {
      }
  
      public BackupRetrievalServiceClient(string endpointConfigurationName) :
          base(endpointConfigurationName)
      {
      }
  
      public BackupRetrievalServiceClient(string endpointConfigurationName, string remoteAddress) :
          base(endpointConfigurationName, remoteAddress)
      {
      }
  
      public BackupRetrievalServiceClient(string endpointConfigurationName, EndpointAddress remoteAddress) :
          base(endpointConfigurationName, remoteAddress)
      {
      }
  
      public BackupRetrievalServiceClient(System.ServiceModel.Channels.Binding binding, EndpointAddress remoteAddress) :
          base(binding, remoteAddress)
      {
      }
  
      public ProformaDataContract GetClientProformaData(string socialSecurityNumber)
      {
          return Execute(client =&gt; client.GetClientProformaData(socialSecurityNumber));
      }
  
      public string GetVersion()
      {
          return Execute(client =&gt; client.GetVersion());
      }
  
      #region Execute
  
      private static TResult Execute&lt;TResult&gt;(Func&lt;IBackupRetrievalService, TResult&gt; function)
      {
          TResult result;
          BackupRetrievalService.BackupRetrievalServiceClient client = new BackupRetrievalService.BackupRetrievalServiceClient();
  
          try
          {
              result = function(client);
          }
          finally
          {
              try
              {
                  if (client.State != CommunicationState.Faulted)
                  {
                      client.Close();
                  }
              }
              catch
              {
                  client.Abort();
              }
          }
  
          return result;
      }
  
      #endregion
  }
  </code></pre>
  
  <p>The error is thrown on the single line in the GetClientProformaData method.</p>