【发布时间】:2011-10-28 21:51:10
【问题描述】:
我在尝试使用与站点挂钩的 Lists.asmx 访问特定站点的文档库的子文件夹中的文档时遇到重大问题。我能够传递文档库的 GUID 并获取其下的文件夹和文件列表,但我无法获取文档库下文件夹中的文件。
这是我的一些代码:
Lists lists = new Lists();
lists.Credentials = System.Net.CredentialCache.DefaultCredentials;
// string listName = "{8F6C3E9B-3160-4EC9-94CB-763DCAE966CB}";
// string listName = "{FA20F595-A568-4FFA-AAAD-C81EFCBD3C42}";
// string listName = "{12B07CC9-9391-49BA-93A3-9C385F21ABD1}";
string listName = "Document%20Library";
string viewName = "";
string tbDetails = "";
// Instantiate an XmlDocument object
System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
System.Xml.XmlNode query = xmlDoc.CreateNode(XmlNodeType.Element, "Query", "");
System.Xml.XmlNode viewFields = xmlDoc.CreateNode(XmlNodeType.Element, "ViewFields", "");
System.Xml.XmlNode queryOptions = xmlDoc.CreateNode(XmlNodeType.Element, "QueryOptions", "");
/*Use CAML query*/
queryOptions.InnerXml = @"<QueryOptions><ViewAttributes Scope='RecursiveAll'/> </QueryOptions> ";
// Get Items related to Customers
XmlNode ndListItems = lists.GetListItems(listName, "", query, viewFields, null, queryOptions, null);
我一直在 ndListItems 内部查看,我只看到文件夹,而不是其中的内容。我还尝试将 GUID 用于我想在其中查看的文件夹,但它失败并出现错误:
列表不存在。 您选择的页面包含一个不存在的列表。它可能已被其他用户删除。 0x82000006
有什么想法吗?
【问题讨论】:
标签: web-services sharepoint list