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