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>
当我不指定任何过滤器时,该代码可以工作...
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...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Value 元素不应位于 FieldRef 元素内。您应该将 FieldRef 和 Value 放入一个父元素中(如 Contains):
Value element should not be inside FieldRef element. You should put both FieldRef and Value into one parent element (like Contains):