CAML query throwing SoapServerException

835 views Asked by At

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">
                  <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...

1

There are 1 answers

2
EvgK On BEST ANSWER

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>