Things hard and not so hard.... RSS 2.0
# Thursday, May 22, 2008

Back in V2.0 we had a Web Service that did this sort of stuff for us, now in V3.0 it's delivered straight from the Object Model.

Essentially:

  1. We create a batch of XML which could have 'adds, updates + deletes' in there.
  2. We call the web.ProcessBatchData(xml) method, handing to it our wishes.

This technique is fast, and CAML based :(

So if you need to add 100 items to the list - this would be a way to do it. (I've got to check whether this technique fires event handlers on the lists or whether it's a 'back door' thing)

Note: in the snippet below, the fields are referenced via their namespace#<name>
- you can get the field's details by saving your list 'As a template', downloading the *.stp file, renaming to *.stp.cab, opening it and looking into the *.xml file there.

- you could also call the lists.asmx webservice (..\_vti_bin\lists.asmx) and calling the GetListCollection(); method to see a chunk of describing XML.

   1:  "<ows:Batch OnError=\"Return\">" +
   2:              "<Method ID=\"A1\"><SetList>" + myGuid + "</SetList>" +
   3:                  "<SetVar Name=\"ID\">New</SetVar>" +
   4:                  "<SetVar Name=\"Cmd\">Save</SetVar>" +
   5:                  "<SetVar Name=" +
   6:                      "\"urn:schemas-microsoft-com:office:office#Title\">" +
   7:                      "New Manager</SetVar>" +
   8:                  "<SetVar Name=" +
   9:                      "\"urn:schemas-microsoft-com:office:office#Body\">" +
  10:                      "Congratulations to Mary for her promotion!</SetVar>" +
  11:                  "<SetVar Name=" +
  12:                      "\"urn:schemas-microsoft-com:office:office#Expires\">" +
  13:                      "2003-09-14T00:00:00Z</SetVar>" + 
  14:              "</Method>" 

Here's a small MSDN article on it - http://msdn.microsoft.com/en-us/library/cc404818.aspx

Cheers,

Mick.

Thursday, May 22, 2008 3:39:46 PM (AUS Eastern Standard Time, UTC+10:00)  #    Comments [0] -
MOSS | Tips
Archive
<May 2008>
SunMonTueWedThuFriSat
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567
Blogroll
 AppFabric CAT
AppFabric Windows Server Customer Advisory Team - New Blog.
[Feed] BizTalk 2006 - Windows SharePoint Services adapter
BizTalk 2006 Sharepoint adapter!!
 Breeze SharePoint 2010 Bootcamp
Breeze SharePoint 2010 Bootcamp
[Feed] BTS 2006 R2/EDI
[Feed] Chris Vidotto (MS BTS Legend)
Needs no intro....
 Mark Daunt
BTS/SPS/.NET GURU!!!
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2012
Breeze
Sign In
Statistics
Total Posts: 530
This Year: 23
This Month: 1
This Week: 0
Comments: 266
All Content © 2012, Breeze