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.
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'.
When I call that same method using the WCFTestClient.exe with the same input parameter I receive a successful reply.
My temp directory has modify access for the Everyone group.
This is the code that I'm using to call the service.
public class BackupRetrievalServiceClient : ClientBase<IBackupRetrievalService>, 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 => client.GetClientProformaData(socialSecurityNumber));
}
public string GetVersion()
{
return Execute(client => client.GetVersion());
}
#region Execute
private static TResult Execute<TResult>(Func<IBackupRetrievalService, TResult> 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
}
The error is thrown on the single line in the GetClientProformaData method.