我正在製作Windows窗體應用程序來檢索有關列表項目的詳細信息。 我做的代碼和它的運行沒有錯誤,但它返回0個項目,即使有列表中的項目 誰能告訴我什麼原因可能是?SharePoint網絡服務GetListItems
這是XML響應我得到:
<listitems xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<rs:data ItemCount="0">
</rs:data>
</listitems>
下面的代碼:
Dim listService As New Lists()
listService.Credentials = System.Net.CredentialCache.DefaultCredentials
listService.Url = "http://sitename/_vti_bin/lists.asmx"
Dim xmlDoc As New System.Xml.XmlDocument()
Dim listName As String = "{83FEDC7E-1DDA-4A36-910A-D5140E51F0ED}"
Dim viewName As String = "{77A23176-5CD4-46E9-BE57-AEB4D4279AD4}"
Dim rowLimit As String = "150"
Dim query As System.Xml.XmlNode = xmlDoc.CreateElement("Query")
Dim viewFields As System.Xml.XmlNode = xmlDoc.CreateElement("ViewFields")
Dim queryOptions As System.Xml.XmlNode = xmlDoc.CreateElement("QueryOptions")
query.InnerXml = "<Query><Where><Contains><FieldRef Name='Title'/><Value Type='Text'>lol</Value></Contains></Where></Query>"
viewFields.InnerXml = ""
queryOptions.InnerXml = "<ViewAttributes Scope='Recursive' />"
Dim nodeListItems As XmlNode
nodeListItems = listService.GetListItems(listName, viewName, query, viewFields, rowLimit, queryOptions, Nothing)
TextBox1.Text += nodeListItems.OuterXml
UPDATE: * 錯誤是,我給在同一個域和用戶名憑據字段。 *
你怎麼能指望我們如果你不告訴我們你是如何找回你的物品的話,可以幫助你。 –
對不起,現在有代碼 請幫忙 – user1648225