2011-02-15 112 views
2

這是例外:CAML查詢扔SoapServerException

Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown. 

這裏的CAML代碼:

<Query> 
<Where> 
    <And> 
    <And> 
    <And> 
     <And> 
     <And> 
      <And> 
      <And> 
       <Contains> 
       <FieldRef Name="Title"> 
        <Value Type="Text">password</Value> 
       </FieldRef> 
       </Contains> 
       <Contains> 
       <FieldRef Name="Answer"> 
        <Value Type="Note">pass</Value> 
       </FieldRef> 
       </Contains> 
      </And> 
      <Eq> 
       <FieldRef Name="PubDestination1"> 
       <Value Type="Text">PCOM</Value> 
       </FieldRef> 
      </Eq> 
      </And> 
      <Eq> 
      <FieldRef Name="PubDestination2"> 
       <Value Type="Text">2</Value> 
      </FieldRef> 
      </Eq> 
     </And> 
     <Eq> 
      <FieldRef Name="FaqCategory"> 
      <Value Type="Text">Autenticação</Value> 
      </FieldRef> 
     </Eq> 
     </And> 
     <Eq> 
     <FieldRef Name="PublicComponent"> 
      <Value Type="Boolean">1</Value> 
     </FieldRef> 
     </Eq> 
    </And> 
    <Geq> 
     <FieldRef Name="PubStartDate"> 
     <Value Type="DateTime" IncludeTimeValue="TRUE">2011-02-07T00:00:00Z</Value> 
     </FieldRef> 
    </Geq> 
    </And> 
    <Leq> 
    <FieldRef Name="PubStartDate"> 
     <Value Type="DateTime" IncludeTimeValue="TRUE">2011-02-25T00:00:00Z</Value> 
    </FieldRef> 
    </Leq> 
    </And> 
</Where> 
</Query> 

代碼工作的時候,不指定任何過濾器...

回答

2

價值元素不應該在FieldRef元素中。您應該將FieldRef和Value都放入一個父元素(如Contains)中:

<Contains> 
    <FieldRef Name="Title"/> 
    <Value Type="Text">password</Value> 
    </Contains> 
+0

對於其他比較運算符是否適用於gt或eq? – 2011-02-15 15:12:29