开发者

SharePoint Lists.asmx's UpdateListItems() returns too much data

Is there a way to prevent the UpdateListItems() web service call in SharePoint's Lists.asmx endpoint from returning all of the fields开发者_如何学Python 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.


I think you are out of luck for wss3/moss2007. In SP2010, the RESTful interface along with the client object model that is built on top of the RESTful interface has more options of selecting what items are returned. You could look into that.


Generally to get data from SharePoint form library a receive data connection to a SharePoint list is taken. But there a couple of drawbacks of this data connection:

It only gives the data of the items in the default view. So if the item limit is 100 then the only the first 100 items data is received. There is no way to query so as to get the information on a certain number of items in the SharePoint form library. To solve these two issues we can take a data connection to the GetListItems method in the Lists SharePoint web service. One thing to note is that any data that you want to query on needs to be present in the view.

A direct data connection to the GetListItems method cannot be taken and this HowTo shows how the data connection can be taken and how to use it to query items.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜