SharePoint Lists.asmx's UpdateListItems() returns too much data
- by Philipp Schmid
Is there a way to prevent the UpdateListItems() web service call in SharePoint's Lists.asmx endpoint from returning all of the fields of the newly created or updated list item? In our case an event handler attached to our custom list is adding some rather large field values which are turned to the client unnecessarily.
Is there a way to tell it to only return the ID of the newly created (or updated) list item?
For example, currently the web service returns something like this:
<Results xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<Result ID="1,Update">
<ErrorCode>0x00000000</ErrorCode>
<z:row ows_ID="4" ows_Title="Title"
ows_Modified="2003-06-19 20:31:21"
ows_Created="2003-06-18 10:15:58"
ows_Author="3;#User1_Display_Name"
ows_Editor="7;#User2_Display_Name" ows_owshiddenversion="3"
ows_Attachments="-1"
ows__ModerationStatus="0" ows_LinkTitleNoMenu="Title"
ows_LinkTitle="Title"
ows_SelectTitle="4" ows_Order="400.000000000000"
ows_GUID="{4962F024-BBA5-4A0B-9EC1-641B731ABFED}"
ows_DateColumn="2003-09-04 00:00:00"
ows_NumberColumn="791.00000000000000"
xmlns:z="#RowsetSchema" />
</Result>
...
</Results>
where as I am looking for a trimmed response only containing for example the ows_ID attribute:
<Results xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<Result ID="1,Update">
<ErrorCode>0x00000000</ErrorCode>
<z:row ows_ID="4" />
</Result>
...
</Results>
I have unsuccessfully looked for a resource that documents all of the valid attributes for both the <Batch> and <Method> tags in he updates XmlNode parameter of UpdateListItems() in the hope that I will find a way to specify the fields to return.
A solution for WSS 3.0 would be preferable over an SP 2010-only solution.