Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

Sharepoint custom wcf service giving error System.UnauthorizedAccessException: Access to the path is denied?

$
0
0

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 ?



Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>