J-O Eriksson

Community Server on my mind

News

Subscribe via FeedBurner

Subscribe via email

<script type="text/javascript"><!-- google_ad_client = "pub-6305396639794057"; google_ad_width = 120; google_ad_height = 240; google_ad_format = "120x240_as"; google_ad_type = "text_image"; google_ad_channel ="5472463295"; google_color_border = "FFFFFF"; google_color_link = "0000FF"; google_color_bg = "FFFFFF"; google_color_text = "000000"; google_color_url = "008000"; //--></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>

Subscribe in NewsGator Online

Subscribe in Bloglines

Add to Google

<script type="text/javascript" src="http://embed.technorati.com/embed/tb2ijzxn26.js"></script>

Blogs I read

Links

Take care of the results from a WSS Web Service

A couple of months ago, I needed to create an application which requested a collection of ListItems from a SharePoint list. SharePoint has a couple of built-in web services OOB, and the one I was interested in was 'Lists' (http://Server_Name/[sites/][Site_Name/]_vti_bin/Lists.asmx), and more precisely the GetListItems method. When I got the request to the webservice to work the returned result was of course in XML :-(. A sample of such a return result could be like:

<listitems xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" 
   xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" 
   xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" 
   xmlns="http://schemas.microsoft.com/sharepoint/soap/">
   <rs:data ItemCount="4">
      <z:row ows_<I>Number_Field</I>="6555.00000000000" ows_Created="2003-06-18T03:41:09Z" 
         ows_ID="3" ows_owshiddenversion="3" />
      <z:row ows_<I>Number_Field</I>="78905456.0000000" ows_Created="2003-06-18T17:15:58Z" 
         ows_ID="4" ows_owshiddenversion="2" />
         .
         .
         .
   </rs:data>
</listitems>

I played around a bit for a while and tried different ways to parse the XML results that I had, but couldn't find anything really good, until I found the following excellent article (by Paul Ballard) which described exactly what I was looking for:

http://weblogs.asp.net/paulballard/archive/2005/05/08/406197.aspx

In my case I used the last method described there, and created a couple of classes to put the results in. After that it was a piece of cake to handle the XML results.

Comments

No Comments