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 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

share|improve this question

2 Answers 2

up vote 4 down vote accepted

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.

share|improve this answer
    
this works, thanks. but it makes no sense to me... –  domueni Oct 31 '11 at 12:47
    
@domueni yeah to me too... –  vikas mehta Oct 31 '11 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 '11 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"/>
          </security>
        </binding>
share|improve this answer
    
thanks for the explanation –  domueni Nov 1 '11 at 15:57
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 '12 at 13:13

Your Answer

 
discard

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

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