Hi,
I am using Sharepoint Lists Web Service to retrieve a list of folders within a Document Library. I use the following code:
XmlDocument xmlDoc = new
System.Xml.XmlDocument();
XmlNode spViewFields = xmlDoc.CreateNode(XmlNodeType.Element, "ViewFields"
, ""
);
XmlNode queryOption = xmlDoc.CreateNode(XmlNodeType.Element, "QueryOptions"
, ""
);
XmlNode spQuery = xmlDoc.CreateNode(XmlNodeType.Element, "Query"
, ""
);
spQuery.InnerXml = "<Where><Contains><FieldRef Name=\"
FileRef\"/><Value Type=\"
Text\">Docuemnt Library</Value></Contains></Where>"
;
XmlNode ndListItems = spListsService.GetListItems("Document Library"
, null
, spQuery, spViewFields, null
, queryOption);
XmlNodeList oNodes = ndListItems.ChildNodes;
However, this only returns folders within Document Library and not the Sub Folders. Is there a way to list the Sub Folders without calling the same code block recursively (using queryOptions.InnerText = <Folder>Document Library/SubFolderName</Folder>
Olorin