我試圖「添加服務引用」SharePoint Web服務(例如「http://cogent-moss/_vti_bin/Webs.asmx」),但我有麻煩。我好像總是出現此錯誤:Visual Studio 2008「添加服務參考」Sharepoint:401和端口號
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.
我已經沖刷網頁的這一解決方案,其中大部分是運行時問題的解決方案。我只想讓Visual Studio 2008爲我生成代理類。
我覺得奇怪的是,如果我嘗試的是同樣的東西,除了指向「http://cogent-moss:8888/_vti_bin/Webs.asmx」,它一切正常。這兩個IIS Virtual Server都是由SharePoint配置的Sharepoint Site Collections,並且都是爲Windows身份驗證配置的。當我指定一個端口號時,發生什麼事會使它工作,但是當我轉到端口80的默認值時,不會發生這種情況。