开发者

CAML query throwing SoapServerException

This is the exception:

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

Here's the CAML code:

<Query>
 <Where>
  <And>
   <And>
    <And>
      <And>
        <And>
          <And>
            <And>
              <Contains>
                <FieldRef Name="Title">
                  <Value Type="Text">password</Value>
                </FieldRef>
              </Contains>
              <Contains>
                <FieldRef Name="Answer">开发者_如何学JAVA
                  <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>

The code works when I don't specify any filters...


Value element should not be inside FieldRef element. You should put both FieldRef and Value into one parent element (like Contains):

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜