7
votes

I am trying to add a reference to the SharePoint list service at https://abcd/_vti_bin/lists.asmx, but I get the following error:

There was an error downloading 'https://abcd/_vti_bin/lists.asmx/_vti_bin/ListData.svc/$metadata'. The request failed with HTTP status 404: Not Found. Metadata contains a reference that cannot be resolved: 'https://abcd/_vti_bin/lists.asmx'. The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Negotiate,NTLM'. The remote server returned an error: (401) Unauthorized. If the service is defined in the current solution, try building the solution and adding the service reference again.

The SharePoint site has Windows Authentication enabled, ASP.NET impersonation enabled, and Anonymous access disabled.

I was able to connect to the service using IE; it prompts for the NT user ID and password. The error shows up when I try to add a reference from a Windows Application.

Any help would be much appreciated.

Environment: Visual Studio 2012, Sharepoint hosted on IIS 7.5, Windows Server 2008 R2

2

2 Answers

0
votes
  • Right click on References folder and then click on “Add Service Reference”.
  • In the “Add Service Reference” wizard click on “Advanced...” button.
  • In the “Advanced” wizard click on “Add Web Reference... and then add the service reference

how to add sharepoint list.asmx web service

-1
votes

To create a service reference to access SharePoint lists

  1. Open or create a Visual Studio project.
  2. In Solution Explorer, right-click the References node, and then click Add Service Reference.
  3. In the Address box, type the URL to the target site and append /_vti_bin/ListData.svc. For example, the address for the site intranet.wingtip.com would be http://intranet.wingtip.com/_vti_bin/ListData.svc.
  4. Change the default name in the Namespace box from ServiceReference1 to something more appropriate, such as WingtipSite.
  5. Click OK to create proxy classes, including a data context and entity classes for the lists that you want to access.
  6. Begin writing code against these proxy classes, which provide strongly typed access to the columns of SharePoint list items.