Fetch (ItemOperations)

The Fetch element is an optional child element of the ItemOperations element in ItemOperations command requests and an optional child element of the Response element in ItemOperations responses. In both contexts, it retrieves an item from the server.

Elements referenced in this section are defined in the ItemOperations namespace, except where otherwise indicated by the presence of a namespace prefix (as defined in section 2.2.4).

Command request/response

Parent elements

Child elements

Data type

Number allowed

ItemOperations command request (section

ItemOperations (section

Store (section

documentlibrary:LinkId (section (optional)

search:LongId (section (optional)

airsync:CollectionId (optional) (section

airsync:ServerId (optional) (section

Options (optional) (section

airsyncbase:FileReference (optional) (section

rm:RemoveRightsManagementProtection ([MS-ASRM] section

container ([MS-ASDTYPE] section 2.2)

0...N (optional)

ItemOperations command response

Response (section

documentlibrary:LinkId (optional)

search:LongId (optional)

airsync:CollectionId (optional)

airsync:ServerId (optional)

Status (section

airsync:Class (optional) (section

airsyncbase:FileReference (optional)

Properties (optional) (section


0...N (optional)

The fetch operation is intended to be used on Windows SharePoint Services technology or UNC document metadata, search results, and items and attachments.

Because the ItemOperations response potentially contains large amounts of binary data, this protocol enables the client to choose a delivery method that is most efficient for its implementation by providing the following two methods to deliver content that is requested by the Fetch element:

  • Inline—The binary content is encoded with base64 encoding and is included inside the WBXML.

  • Multipart—This method involves a multipart structure in which the WBXML is the first part, and the requested data populates the subsequent parts. This format enables a client to handle large files without consuming large amounts of memory.

The inline approach generally requires the client to read the WBXML part into memory in order to parse it, thereby consuming a large amount of memory. The multipart approach enables the client to parse the small WBXML part, obtain references to the binary parts, and handle the binary parts as necessary, without reading the whole response into memory.

In the request, the client specifies the location and a byte range for the item. The location is indicated by either a link ID (documentlibrary:LinkId element) if the target item is identified by a URI, or a file reference (airsyncbase:FileReference element (section if the client is retrieving an email attachment. The location is indicated by a server ID (airsync:ServerId element) if an ActiveSync ID is being used to identify the item.

The Fetch element supports several options, such as byte ranges, body preference, and schema, as specified in section

The ItemOperations command response contains either the requested byte range of the item, or an error code that indicates why the fetch failed.

Multiple fetch operations can be included within one ItemOperations request. In this case, the fetch operations are executed in the order that is specified.

For more information about the Fetch element, see section

Protocol Versions

The following table specifies the protocol versions that support this element. The client indicates the protocol version being used by setting either the MS-ASProtocolVersion header, as specified in [MS-ASHTTP] section, or the Protocol version field, as specified in [MS-ASHTTP] section, in the request.

Protocol version

Element support