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

SharePoint Lists Web Service Proxy Unauthorized Error

$
0
0

I am trying to get data from a SharePoint list by using SharePoint Lists Web service. I have a MS Office Excel Add-In with a WPF User Control inside it. I used the following code to make a proxy object to the Lists Web Service. And use that proxy to obtain list 'Products'.

1.SPListWS.Lists myListReadProxy =newSPListWS.Lists();2. myListReadProxy.Credentials=System.Net.CredentialCache.DefaultCredentials;3. myListReadProxy.Url="http://sp2010:4321/_vti_bin/Lists.asmx";4.5.XmlNode myNode = myListReadProxy.GetList("Products");

Visual Studio come up with an error at the line 5, saying that

The request failed with HTTP status 401: Unauthorized.

I changed the code as following to provide credentials explicitly. But the same error arises.myListReadProxy.Credentials = new NetworkCredential("myusername", "mypassword");

And I checked the permission for the web service and the List. I have full permission. When I handle the Web Exception is gives the status as 'Protocol Error'.

Can you please help me with this?



Viewing all articles
Browse latest Browse all 11571

Trending Articles



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