如何使用网络服务通过共享点列表递归迭代? [英] How can I iterate recursively though a sharepoint list using webservices?
问题描述
在 sharepoint 网络服务中,我可以使用 getListItems() 来获取列表的子元素.
in sharepoint webservices, I can use getListItems() to obtain the child elements of a list.
在文档库中,有时元素是文件夹.
In a document library, sometimes the element is a folder.
"ows_FSObjType = 1"
有什么办法可以向SP询问这个文件夹的子元素吗?
Is there any way to ask SP for the child elements of this folder?
使用文件夹 ID 查询 getListItems() 给我一个 SOAP 异常.
Querying with getListItems() using the folder ID gives me a SOAP Exception.
我发现这个webservice有更多的方法
I found that this webservice has got more method
有一个枚举文件夹"方法,它有一个isFolder"属性,但没有递归它的内容的方法.
There is an "enumerate folder" method, which has got a "isFolder" property, but no method to recurse its contents.
谢谢你,山姆.:)
推荐答案
在 GetListItems 方法中,可选参数之一是名为QueryOptions"的 XMLNode.您可以放入该节点的元素之一是
.
On the GetListItems method, one of the optional parameters is an XMLNode called "QueryOptions". One of the elements you can put in that node is <Folder>
.
所以你应该能够传入如下内容:
So you should be able to pass in something like:
<QueryOptions>
<Folder>/My/Path/Here</Folder>
</QueryOptions>
我可能在语法上有点偏离(在发布这篇文章时没有尝试构建和运行查询),但总体思路应该是合理的.您可以在 MSDN GetListItems 参考 中查看更多详细信息一>.
I may be off a bit syntatically (didn't try to build and run a query when making this post), but the general idea should be sound. You can see more details on this in the MSDN GetListItems Reference.
这篇关于如何使用网络服务通过共享点列表递归迭代?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!