I wanted to use the REST Service in an application. So when I add the service reference in Visual Studio I get this error

There was an error downloading 'http://myMainSite/sites/subSite/_vti_bin/ListData.svc'. The request failed with HTTP status 400: Bad Request. Metadata contains a reference that cannot be resolved: 'http://myMainSite/sites/subSite/_vti_bin/ListData.svc'. The remote server returned an unexpected response: (400) Bad Request.

When I access the Service-URL in the browser I get the definition xml

2 Answers 2


i also got it and solved ..

  1. temporarily turn off anonymous authentication on the web application... this can be done as...

Open Internet Information Services (IIS) Manager:

If you are using Windows Vista or Windows 7: On the taskbar, click Start, and then click Control Panel. Double-click Administrative Tools, and then double-click Internet Information Services (IIS) Manager. In the Connections pane, expand the server name, expand Sites, and go to the level in the hierarchy pane that you want to configure, and then click the Web site or Web application. Scroll to the Security section in the Home pane, and then double-click Authentication. In the Authentication pane, select Anonymous Authentication, and then click Disable in the Actions pane.

  • this works, thanks. but it makes no sense to me...
    – domueni
    Oct 31, 2011 at 12:47
  • @domueni yeah to me too... Oct 31, 2011 at 13:07
  • Welcome to SharePoint.StackExchange.com and thanks for providing an accepted answer! You might improve this answer by including a link to an accepted reference site like MSDN.microsoft.com
    – Tom Resing
    Oct 31, 2011 at 20:43

The authentication under _vti_bin should be only 'Windows' and not 'Anonymous'. So you need to change it from IIS.

Reason : The mex endpoint uses mexHttpBinding which is configured to use Windows Auth in web.config ( in 14\ISAPI folder);

<binding name="mexHttpBinding">
          <security mode="TransportCredentialOnly">
            <transport clientCredentialType="Windows" proxyCredentialType="Windows"/>
  • 1
    I tried your solution, but for me it didn't help. If I change the _vti_bin folder authentication to only "windows" than I can not open the listdata.svc even from the browser... Any other ideas?
    – user7932
    Apr 19, 2012 at 13:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.