Question

Using server-side code I can access List Item version history using SPListItem.Versions.

Is there a way to programmatically access the same information from the client?

I am happy to use either the Client Object Model, SharePoint Web Services or any other mechanism.

Note:

  1. I am trying to access this information remotely - please don't answer with server-side code.
  2. I am not trying to access FileVersionHistory - I'm after history for the ListItem itself.
  3. Custom web service is not an option.
Was it helpful?

Solution

Take a look at my answer provided to very similar question:

Get meta data from a previous version of a document through webservice in MOSS 2007

Using web service and Lists.GetVersionCollection Method is (as far as I know) only available option. So you need to call it for each field of your item.

Client object model is not an option.

UPDATED

To get all versions of version field you just need to call GetVersionCollection method on version field by passing it's internal name _UIVersionString

Simple code snippet:

ListProxy.Lists lists = new Lists();
lists.UseDefaultCredentials = true;
XmlNode versions = lists.GetVersionCollection("{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx}", 
                                                       "n", "_UIVersionString");
foreach(XmlNode version in versions.ChildNodes)
{
    Console.WriteLine(version.Attributes["_UIVersionString"].Value);
}
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top