views:

1053

answers:

4

I'm trying to "Add Service Reference" to SharePoint web services (e.g., "http://cogent-moss/_vti_bin/Webs.asmx"), but am having trouble. I seem to always get this error:

The document at the url http://cogent-moss/_vti_bin/Webs.asmx was not recognized as a known document type. The error message from each known type may help you fix the problem: - Report from 'http://cogent-moss/_vti_bin/Webs.asmx' is 'The document format is not recognized (the content type is 'text/html; charset=utf-8').'. - Report from 'DISCO Document' is 'Root element is missing.'. - Report from 'WSDL Document' is 'The document format is not recognized (the content type is 'text/html; charset=utf-8').'. - Report from 'XML Schema' is 'The document format is not recognized (the content type is 'text/html; charset=utf-8').'. Metadata contains a reference that cannot be resolved: 'http://cogent-moss/_vti_bin/Webs.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.

I've scoured the web for solutions to this, and most of them are solutions to run-time problems. I merely want to get Visual Studio 2008 to generate the proxy classes for me.

What's strange to me is that if I try the very same thing, except pointed at "http://cogent-moss:8888/_vti_bin/Webs.asmx", it all works fine. Both of these IIS VirtualServers are Sharepoint Site Collections, configured by SharePoint, and both are configured for Windows authentication. What's going on that would make it work when I specify a port number, but not when I go to the default at port 80?

A: 

It sounds like you have an extended web application in SharePoint where port 80 is extended to port 8888 and port 80 allows anonymous but port 8888 requires Windows Authentication. Have you checked in IIS Manager to see if that is the case?

Kirk Liemohn
A: 

If it's not a question of authtentication types, as Kirk suggested, are your Alternate Access Mappings set up for both port 8888 and port 80?

Abs
+1  A: 

Hello,

I had exactly the same problem, i think you should try adding the service reference from VS as "http://cogent-moss:8888/_vti_bin/Webs.asmx?WSDL" instead of "http://cogent-moss:8888/_vti_bin/Webs.asmx"

Hope that helps,

A: 

I had the same problem. I went to sharepoint site administration, application management. In the application security area, select authentication providers. On the new page, choose default, and on the new page select enable anonymous. Not sure if this worked yet as I am getting other problems, but it does seem to have removed the authentication issue. I'd already set up anonymous on the IIS VD, but was getting the same error, so I took a look around the sharepoint admin page.

Hope this helps Nick

Nick Browne