Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

OfficialFile.asmx The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Negotiate,NTLM'. ERROR

$
0
0

We are getting an error on the authentication piece when trying to submit a file to the OfficialFile.asmx web service to submit a document to the Drop-Off Library. Here is the code snippet -

        public string FileUpload(HttpPostedFile FileInput, RecordsRepositoryProperty[] properties)
        {
            string strFileUrl = string.Empty;
            RecordsRepositorySoapClient repository = new RecordsRepositorySoapClient();
            BinaryReader b = new BinaryReader(FileInput.InputStream);
            byte[] binData = b.ReadBytes(FileInput.ContentLength);
            repository.ClientCredentials.Windows.ClientCredential = new System.Net.NetworkCredential(iUserID, iUserPassword, iUserDomain);
            repository.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;
            repository.SubmitFile(binData, properties, null, FileInput.FileName, HttpContext.Current.User.Identity.Name);
            strFileUrl = repository.GetFinalRoutingDestinationFolderUrl(properties, null, FileInput.FileName).Url;
            return strFileUrl;
        }

Although we are setting the network credential in the client call we still get the error- The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Negotiate,NTLM'.

Ideas?

Thanks in advance.


Viewing all articles
Browse latest Browse all 11571

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>