I developed a custom ASP.NET application where I retrieve/update list and document library items using REST. It works perfectly fine locally but when I deploy it to a web server it doesn't work the same. Once it's deployed to the web server I'm able to retrieve list and document library items but I'm unable to update the document library items. Though I can still update the list items.

I get a very generic error messages and there isn't anything in the log files for the web server or SharePoint servers. This is the error:

Exception Details: System.Data.Services.Client.DataServiceClientException: 
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<message xml:lang="en-US">An error occurred while processing this request.</message>

Why does everything work fine locally but when I deploy it to a web server the REST update doesn't happen on the document library? Anyone else experience this issue?

  • do the sharepoint event log or windows event log have any information regarding the error in them?
    – Colin
    Commented Jun 24, 2011 at 17:10
  • The only error that's logged is the exception I had in my original post. This is logged on the event viewer on the web server doing the update. There is nothing in SharePoint logs.
    – davidevan
    Commented Jun 24, 2011 at 17:16
  • Could this be an authentication issue? Did you build / test the code on a single machine and are you now trying it from 1 machine to another? SharePoint can be pretty "particular" about POST / PUT requests
    – Colin
    Commented Jun 24, 2011 at 17:43
  • I built and tested the code on a different machine than SharePoint. It only seems to work fine when I run the application in Visual Studio (debugging mode). Once it's deployed to a web server it doesn't update document library items. I even changed the application pool to run under my own indetity (same as when I run it in Visual Studio) and I'm still experiencing the issue.
    – davidevan
    Commented Jun 24, 2011 at 18:48
  • Scratch my most answer then :-D. Could you try to add the code from answer if you haven't done so already yourself? Can you enable fiddler to see what requests / responses are being sent?
    – Colin
    Commented Jun 24, 2011 at 19:04

1 Answer 1


Code running on the same machine is very difficult to test because of the fact there are no security boundaries, i.e. different machines. My money is on a security issue. Never used REST to talk to a service before, but for consuming services running under sharepoint tyou need to pass credentials and set the impersonation level:

client.Endpoint.Address = new EndpointAddress("serviceurl");
client.ClientCredentials.Windows.AllowedImpersonationLevel = TokenImpersonationLevel.Impersonation;

Then, seeing as this is an ASP.NET app, the app pool account of your ASP.NET app needs to have read access to sharepoint. If it is running under one of the default system accounts (ASPNET or NetworkService), change the app pool identity to a domain account, give that "logon as service" and "logon as batch" permissions (either through local security policy on the server it runs on itself or through domain policies).

Then give the app pool account read access to the sharepoint web app (easiest is through central admin -> web app -> user policy)

  • I changed the application pool of my ASP.NET app to run under myself. I'm a farm administrator and I still have the same problem with updating the document library item from a web server. As I mentioned the SharePoint environment is not on the same machine where I did my development. Though it works perfectly fine when I update document library items from my devlopment machine. As soon as I deploy it out to the web server I experience problems updating a document library using REST. Perhaps I'm missing a hotfix or update on the web server that I have locally?
    – davidevan
    Commented Jun 28, 2011 at 15:10
  • Being a farm admin doesn;t make you a site collection admin. They are very much separated. But this does sound very weird though....
    – Colin
    Commented Jun 28, 2011 at 19:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.