Warum <ViewFields - > Kriterien bekommen, ignoriert von der SharePoint-Liste Service-Methode GetListItems

Obwohl ich angeben ViewFields-element in meiner sharepoint-Liste service ist GetListItems-Abfrage, die alle Felder zurückgegeben werden. Der folgende code erstellt die Anfrage:

XmlDocument xmlDoc = new System.Xml.XmlDocument();
XmlNode query = xmlDoc.CreateNode(XmlNodeType.Element, "Query", "");
XmlNode viewFields = xmlDoc.CreateNode(XmlNodeType.Element, "ViewFields", "");
XmlNode queryOptions = xmlDoc.CreateNode(XmlNodeType.Element, "QueryOptions", "");    

... set query ...

viewFields.InnerXml = "<FieldRef Name='LinkFilename' /><FieldRef Name='FileDirRef' /><FieldRef Name='FileLeafRef' />";            

queryOptions.InnerXml = "<IncludeMandatoryColumns>FALSE</IncludeMandatoryColumns><DateInUtc>TRUE</DateInUtc><Folder>Resource Management Tools</Folder><ViewAttributes Scope='Recursive' />";

XmlNode xmlNode = SharePointListWebService.GetListItems(
_listServiceConfigurationSettings.ListName,
                                string.Empty,
                                query,
                                viewFields,
                                null,
                                queryOptions,
                                null);

Laut Spielmann, diese Ergebnisse in die folgende soap-Umschlag an die Liste geschickt-service:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Body>
    <GetListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/">    
      <listName>Shared Documents</listName>
      <viewName />
      <query>
        <Query xmlns="">
          <Where>
            <And>
              <Contains>
                <FieldRef Name="FileLeafRef" />
                <Value Type="Text">.xls</Value>
              </Contains>
              <Geq>
                <FieldRef Name="Modified"
                IncludeTimeValue="True" />
                <Value Type="DateTime">2010-05-10T11:53:32Z</Value>
              </Geq>
            </And>
          </Where>
          <OrderBy>
            <FieldRef Name="FileDirRef" />
          </OrderBy>
        </Query>
      </query>
      <viewFields>
        <ViewFields xmlns="">
          <FieldRef Name="LinkFilename" />
          <FieldRef Name="FileDirRef" />
          <FieldRef Name="FileLeafRef" />
        </ViewFields>
      </viewFields>
      <queryOptions>
        <QueryOptions xmlns="">
          <IncludeMandatoryColumns>FALSE</IncludeMandatoryColumns>
          <DateInUtc>TRUE</DateInUtc>
          <Folder>Resource Management Tools</Folder>
          <ViewAttributes Scope="Recursive" />
        </QueryOptions>
      </queryOptions>
    </GetListItems>
  </soap:Body>
</soap:Envelope>

sowie die folgende soap-Antwort zurückgegeben wird von der service:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Body>
    <GetListItemsResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/">
      <GetListItemsResult>
        <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'>
          <rs:data ItemCount="19">
            <z:row ows_LinkFilename='[SENSITIVE DATA].xls'
            ows_FileDirRef='278;#sites[SENSITIVE DATA]'
            ows_FileLeafRef='278;#[SENSITIVE DATA].xls'
            ows_MetaInfo='278;#Subject:SW| vti_parserversion:SR|12.0.0.6421 ContentTypeId:SW|0x0101006C2E647253A1074FB6079F08E5F2A395 _Author:SW|[SENSITIVE DATA] _Category:SW| vti_author:SR|[SENSITIVE DATA] _Comments:SW| vti_approvallevel:SR| vti_categories:VW| vti_cachedcustomprops:VX|vti_approvallevel vti_categories Subject vti_assignedto Keywords _Author _Category _Comments vti_assignedto:SR| Keywords:SW| vti_modifiedby:SR|[SENSITIVE DATA]'
            ows__ModerationStatus='0' ows__Level='1'
            ows_Last_x0020_Modified='278;#2010-06-29T18:55:38Z'
            ows_ID='278' ows_owshiddenversion='53'
            ows_UniqueId='278;#{0E51B2B1-89A7-4895-8ECC-0FE7D420470C}'
            ows_FSObjType='278;#0'
            ows_Created_x0020_Date='278;#2009-03-09T16:06:41Z'
            ows_ProgId='278;#' ows_Modified='2010-06-29T18:55:37Z'
            ows_FileRef='278;#sites[SENSITIVE DATA].xls'
            ows_DocIcon='xls'
            ows_Editor='262;#[SENSITIVE DATA]' />            
          </rs:data>
        </listitems>
      </GetListItemsResult>
    </GetListItemsResponse>
  </soap:Body>
</soap:Envelope>

Bemerken, z:row-element hat mehr Felder enthalten, als ich angegeben in meinem ViewFields-Kriterien. Ich habe auch eingestellt IncludeMandatoryColumns auf false in meiner Abfrage-Optionen. Habe ich etwas falsch gemacht oder muss ich nicht verstehen, wie ViewFields wirklich so funktioniert, wie ich dachte, es würde begrenzen die Felder, D. H. z:row-Attribute wird von der SharePoint-Liste service.

Schreibe einen Kommentar