获取列表项时给出“Microsoft sharepoint soapserver soap server exception”

时间:2012-07-31 06:24:44

标签: sharepoint sharepoint-2010

我正在尝试使用webservice参考模型获取列表项。 我试图获取列表的详细信息

  SPSeriveReference.Lists client = new SPSeriveReference.Lists();

                client.Credentials = new NetworkCredential("Administrator", "pswd","MyDomain");
                XmlDocument mydoc = new XmlDocument();
                XmlElement viewFileds = mydoc.CreateElement("ViewFields");
                viewFileds.InnerXml = "<FieldRef Name=\"Title\" />" +
        "<FieldRef Name=\"Name\" />" +
        "<FieldRef Name=\"Address\" />";
                XmlNode listItems = client.GetListItems("Manager", null, null, viewFileds, null, null, null); //a4af13f3-69f6-45e3-930d-8c2ce61a10fd
                //XmlNode listItems = client.GetListItems("Manager", null, null, viewFileds, null, null, null);
                foreach (XmlNode node in listItems)
                {
                    if (node.Name == "rs:data")
                    {
                        for (int i = 0; i < node.ChildNodes.Count; i++)
                        {
                            if (node.ChildNodes[i].Name=="z:row")
                            {
                                string title = node.ChildNodes[i].Attributes["ows_Title"].Name;
                                string name = node.ChildNodes[i].Attributes["ows_Name"].Name;
                                string address = node.ChildNodes[i].Attributes["ows_Address"].Name;
                                Console.WriteLine(title + " " + name + " " + address);
                            }
                        }
                    }
                }

但这会将运行时异常视为“Microsoft.SharePoint.SoapServer.SoapServerException” 这个解决方案是什么? 我验证了堆栈溢出中的问题,这些问题之前曾被问过同样的错误。但是没有一个能为这个问题提供解决方案。

0 个答案:

没有答案