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)
{
try
{
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("http://wss.test.com/sites/WebService/Test 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);
Console.ReadLine();
}
}
}
}
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()
?