SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to check out a file using the Lists web service. Here is my code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Soap = System.Web.Services.Protocols;

namespace SharepointTest
    class Program
        static void Main(string[] args)
                WebService.Lists listsService = new WebService.Lists();
                listsService.Url = "http://wss/sites/WebService/_vti_bin/lists.asmx";
                listsService.Credentials = System.Net.CredentialCache.DefaultCredentials;
                console.WriteLine(listsService.CheckOutFile(" File.xlsm", "false", "Wed, 28 Nov 2012 14:17:50 GMT"));

            catch(Soap.SoapException ex)
                Console.WriteLine("<br>File Check Out Exception: " + ex.Detail.InnerText);

I obtained the date parameter for CheckOutFile() by using GetListItems() to get the Last Modified field contents. The call to CheckOutFile() raises the following SoapException:

"Save Conflict"

"Your changes conflict with those made concurrently by another user. 
If you want your changes to be applied, click Back in your Web browser,
refresh the page, and resubmit your changes.0x8107054a"

I can see in my web browser that the file is not currently checked out to anyone, and I can check it out and in through the browser. Any idea why I can't use CheckOutFile()?

share|improve this question

I figured out what was wrong. The date string was actually in PST, not GMT; I needed to convert it to the correct GMT using the following code:

public static string convertToGMT(DateTime dt)
            TimeZoneInfo pst = TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time");
            DateTime utc_dt=TimeZoneInfo.ConvertTimeToUtc(dt, pst);
            string output = utc_dt.ToString("r");
            return output;
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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