簡體   English   中英

嘗試調用共享點列表服務時獲取“ Microsoft.SharePoint.SoapServer.SoapServerException”

[英]Getting 'Microsoft.SharePoint.SoapServer.SoapServerException' when trying to call sharepoint Lists Service

以下代碼給出了“ 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);
        }
    }

代碼有什么問題嗎,還是我需要更改任何配置。 在客戶端或服務器端。 謝謝。

Microsoft.SharePoint.SoapServer.SoapServerException是一個常見的肥皂錯誤,您需要將代碼包裝在try和catch中,以獲取正確的異常。

嘗試使用Fiddler,這將幫助您了解Soap Request內部的情況。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM