为 AJAX 创建复合 SOAP 查询条件
我有一段使用 Jquery 与 Sharepoint 服务器通信并从 sharepoint 获取列表数据的代码。该过滤器是用 SOAP 信封指定的,即下面的代码。目前它只有一个查询条件(查询标记内的代码),但是我希望有两个或多个条件并用 AND 逻辑将它们串在一起。任何帮助将不胜感激!
soapEnv =
"<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'> \
<soapenv:Body> \
<GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'> \
<listName>Risks Issues</listName> \
<query>\
<Query>\
<Where>\
<Eq>\
<FieldRef Name='Project'/>\
<Value Type='Text'>XYZ</Value>\
</Eq>\
</Where>\
</Query>\
</query> \
<viewFields> \
<ViewFields> \
<FieldRef Name='Urgency' /> \
<FieldRef Name='Item Type' /> \
</ViewFields> \
</viewFields> \
</GetListItems> \
</soapenv:Body> \
</soapenv:Envelope>";
I have a piece of code using Jquery to talk to Sharepoint server and get list data out of sharepoint. The filter is specified with a SOAP enevelope, which is the code below. Currently it has only one query conditon (the code within the query tag), however I would like to have two or more conditions and string them together with AND logic. Any help will be much appreciated!
soapEnv =
"<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'> \
<soapenv:Body> \
<GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'> \
<listName>Risks Issues</listName> \
<query>\
<Query>\
<Where>\
<Eq>\
<FieldRef Name='Project'/>\
<Value Type='Text'>XYZ</Value>\
</Eq>\
</Where>\
</Query>\
</query> \
<viewFields> \
<ViewFields> \
<FieldRef Name='Urgency' /> \
<FieldRef Name='Item Type' /> \
</ViewFields> \
</viewFields> \
</GetListItems> \
</soapenv:Body> \
</soapenv:Envelope>";
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

对 where 子句使用 此类语法:
use such syntax for your where clause: