开发者

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

Th following code is giving 'Microsoft.SharePoint.SoapServer.SoapServerException'

    public class SP_Access
    {
        ListsSoapClient _proxy;
        XElement _lists; 

        public SP_Access()
        {
            _proxy = new ListsSoapClient();

            //authenticcation
            _proxy.ClientCredentials.Windows.Cli开发者_JS百科entCredential = 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);
        }
    }

Is anything wrong with the code, or should I need to change any config. at client or server side. Thanks.


Microsoft.SharePoint.SoapServer.SoapServerException is a generic soap error, you need to wrap your code inside of try and catch to get the correct exception.


Try using Fiddler, this will help you to see what's going on inside of Soap Request.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜