得到& # 39;Microsoft.SharePoint.SoapServer.SoapServerException

本文关键字:SharePoint SoapServer SoapServerException Microsoft 得到 | 更新日期: 2023-09-27 18:07:03

下面的代码给出了'Microsoft.SharePoint.SoapServer。SoapServerException '

    public class SP_Access
    {
        ListsSoapClient _proxy;
        XElement _lists; 
        public SP_Access()
        {
            _proxy = new ListsSoapClient();
            //authenticcation
            _proxy.ClientCredentials.Windows.ClientCredential = new System.Net.NetworkCredential();
            //Define the parameters for the service call
            XElement query = new XElement("Query");
            XElement queryOptions = new XElement("QueryOptions");
            XElement viewFields = new XElement("ViewFields",
                                        new XElement("FieldRef", new XAttribute("Name", "Employer")),
                                        new XElement("FieldRef", new XAttribute("Name", "Address")));
            _lists = _proxy.GetListItems("Search Files",
                    null,
                    query,
                    viewFields,
                    null,
                    queryOptions,
                    null);
        }
    }

是任何错误的代码,或者我应该改变任何配置。在客户端或服务器端。谢谢。

得到& # 39;Microsoft.SharePoint.SoapServer.SoapServerException

Microsoft.SharePoint.SoapServer。SoapServerException是一个通用的soap错误,您需要将代码包装在try和catch中以获得正确的异常。

尝试使用Fiddler,这将帮助您看到Soap请求内部发生了什么