I have deployed one custom wcf serice inside ISAPI folder of sharepoint foundation 2010. The service is working properly. This sharepoint is on another machine and my client application which cosumes this wcf service is on another machine. The client application resides on my machine. I am able to upload and download document through this service. In custom wcf service I want the byte array of file. The file exists on shared folder on my colleage system. Please note my colleage machine and sharepoint machine are two different machines. I am able to access the file from my windows explorer using ip address of my colleage. I am also able to read byte array of this file from my system using C# application. I am using following code
byteArr = File.ReadAllBytes(objDocument.FilePath);When I place the same code in custom wcf service, it gives me error System.UnauthorizedAccessException. My code is running under administartive previleges. The application pool identity under which my current web application is running is the sharepoint farm account. Can you please guide me why I am getting this error ? Can you please provide me any code or link through which I can resolve the above issue ?