It has been a long time coming and I was finally able to find a diamond in the rough by locating a wrapper for the “challenging” yet powerful Lists.asmx service provided by WSS 3.0. On my current project we had the need to interact with WSS to pull back some document templates that reside in a document library. It only made sense for the implementation of this repository to use Lists.asmx or interact with a custom service that uses the SharePoint object model. I figured by now someone had created a simplified way to interact with Lists.asmx without having to deal with all of the complexities of the XML. After using multiple search engines, I found a comment in a Blog that subtly mentioned the solution. Hidden away at the very end of an article on MSDN, http://msdn.microsoft.com/en-us/library/dd365137.aspx, there is mention of SharePointUtility.dll. This assembly includes the static wrapper class. It is part of a great project on CodePlex that focuses on SSIS extensions, http://www.codeplex.com/SQLSrvIntegrationSrv. A co-worker actually just used this today to move data from one column in a list to another and it worked like a charm.
The assembly can be downloaded as a separate download or you can get the source from the source control tab on http://www.codeplex.com/SQLSrvIntegrationSrv. While we are currently only using this for development, so far so good. Here is a sample of its usage of getting data from a document library:
public List<ServicePaperworkTemplate> FindForServices(List<Service> services)
List<ServicePaperworkTemplate> results = null;
List<Dictionary<string, string>> resultFromSharePoint = null;
string queryString = default(string);
//These are the fields that we want in the result set.
string resultFields = new string
queryString = _buildCamlQueryForFilteringByServiceAbbreviation(services);
query = XElement.Parse(queryString);
//Query SharePoint for the list items based on the CAML query string.
resultFromSharePoint = ListServiceUtility.GetListItemData(SharePointSiteUrl, Lists.ServicePaperworkTemplates,
resultFields, query, true, 10) as List<Dictionary<string, string>>;
//Translate from the results to the list of business entities.
results = EntityFactory.Create(resultFromSharePoint, false) as List<ServicePaperworkTemplate>;
//Fill in the documents.