2013-03-10 61 views
0

我试图通过web服务更新SharePoint 2010列表。我的代码可以成功更新ROOT级别(或网站集级别)上的任何列表。只有当我尝试更新变体级别上的任何列表时,应用程序才会抛出错误“此处引用的列表不再存在”。 请记住我已经尝试设置list.url属性。手动更新app.config。任何更多的想法请分享。我的代码:Sharepoint 2010通过webservice更新列表更新抛出错误

 try 
     { 
      System.Xml.XmlNode ndListView = list.GetListAndView("{GUID}", ""); 
      string strListID = ndListView.ChildNodes[0].Attributes["Name"].Value; 
      string strViewID = ndListView.ChildNodes[1].Attributes["Name"].Value; 
      XmlElement xmlBatchElement = xmlDoc.CreateElement("Batch"); 
      xmlBatchElement.SetAttribute("ListVersion", "1"); 
      xmlBatchElement.SetAttribute("OnError", "continue"); 
      xmlBatchElement.SetAttribute("ViewName", strViewID); 
      xmlBatchElement.InnerXml = TheCaml; // TheCaml holds XML updates. 
      try 
      { 
       XmlNode xmlReturn = list.UpdateListItems(strListID, xmlBatchElement); 

// UpdateListItems给出了错误,列表不再存在。

+0

我试过list.getlistcollection(),它只返回根级的列表。我可能在web服务上做错了什么? – 2013-03-10 12:07:30

回答

0

原来,我使用IP地址作为服务引用,而我应该使用服务器名称而不是IP地址。