Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a simple get list method for sharepoint

    /// <summary>
    /// Returns a list of sharepoint lists
    /// </summary>
    /// <returns>A list of sharepoint lists</returns>
    private string GetSharePointLists()
    {     
        StringBuilder stringBuilder = new StringBuilder();
        try
        {

            SharePointList.ListsSoapClient proxy = new SharePointList.ListsSoapClient();
            proxy.ClientCredentials.Windows.ClientCredential = new NetworkCredential();
            XmlElement lists = proxy.GetListCollection();
            var q = from c in lists.ChildNodes.Cast<XmlNode>()
                    select new
                    {
                        DefaultViewUrl = c.Attributes["DefaultViewUrl"].Value,
                        Title = c.Attributes["Title"].Value
                    };

            foreach (var x in q)
            {
                stringBuilder.AppendLine(string.Format("{0} http://REMOVED/{1}", x.Title, x.DefaultViewUrl.Replace(" ", "%20")));
            }
        }
        catch (Exception ex)
        {
            throw new Exception(ex.ToString());
        }
        return stringBuilder.ToString();
    }

It works fine on my dev box. It used to work fine on my test machine as well. Once the test machine was rebuilt I always get this error on proxy.GetListCollection()-

The HTTP request is unauthorized with client authentication scheme 'Ntlm'. The authentication header received from the server was 'NTLM'.

Anyone know what's going on here and how to fix it?

share|improve this question
add comment

2 Answers 2

up vote 1 down vote accepted

It turns out the 401 access denied message was nothing more than it seemed. The webservice worked on all other machines because they all had permission to sharepoint webservices.

The user the newly rebuilt server connected as did not. I added the user the server runs as to the "People and Groups" with the appropriate permissions and the list ran fine.

share|improve this answer
add comment

Check if you have placed the clientaccesspolicy.xml and crossdomain.xml in the site root folder http://msdn.microsoft.com/en-us/library/cc197955(VS.95).aspx

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.