09 October 2009

Resources: LINQ to XML for SharePoint Lists Web Service

As I have been continuing the development of the end-to-end solution, I have been doing a lot of work with the SharePoint web services -- specifically the lists.asmx web service used for working with lists in SharePoint.

Anyone who has dealt with this web service knows that SharePoint is happy to provide you with a lot of XML to parse. In an effort to make these easier, I began exploring the use of LINQ to XML since I'm not the biggest fan of writing my own XPath queries. In this quest, I came across two articles that were very useful and I hope you will find these useful as well.

Using LINQ to XML in combination with the Lists.asmx
This article describes how to use LINQ to XML in conjunction with the  GetListCollection() method of the lists.asmx web service. I made use of this in my client application to populate a combo-box.

SharePoint to Linq
Using this site, I was able to learn how to use LINQ to XML to build queries and anonymous types for data-binding list data to my client application.

I'm in the process of refactoring some of the end-to-end solution I've been working on, so that has slowed me down a bit in getting the next posts up. I hope to get the refactoring completed soon so I can share the steps I've taken to create an end-to-end solution in SharePoint 2007.

No comments: