How can I iterate recursively though a sharepoint list using webservices?

不羁岁月 提交于 2020-02-01 09:39:31

问题


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"

Is there any way to ask SP for the child elements of this folder?

Querying with getListItems() using the folder ID gives me a SOAP Exception.

Edit:

I found that this webservice has got more method

Site Data Webservice

There is an "enumerate folder" method, which has got a "isFolder" property, but no method to recurse its contents.

Thank you, Sam. :)


回答1:


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>

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.



来源:https://stackoverflow.com/questions/173784/how-can-i-iterate-recursively-though-a-sharepoint-list-using-webservices

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!