简体   繁体   English

更新WCF服务参考时出现401未经授权的错误

[英]401 Unauthorized error when updating WCF service reference

We have a WCF service hosted through IIS8 on our internal company network. 我们在公司内部网络上通过IIS8托管了WCF服务。 The service has anonymous authentication disabled & only Windows authentication is enabled. 该服务已禁用匿名身份验证,并且仅启用了Windows身份验证。 When accessing the service in a browser, a dialog pops up asking for domain credentials. 在浏览器中访问服务时,会弹出一个对话框,询问域凭据。 Once valid credentials are supplied, the service comes up successfully. 提供有效的凭据后,该服务将成功启动。

I am now trying to update a service reference in a project in Visual Studio 2013 to this service. 我现在正在尝试将Visual Studio 2013中的项目中的服务引用更新为此服务。 The original reference was created before the changes were made to the authentication. 原始参考是在对身份验证进行更改之前创建的。 Now, when trying to perform the reference update, I get a 401 Unauthorized error, as Visual Studio is trying to pass anonymous authentication credentials & it is failing. 现在,当尝试执行参考更新时,我收到401未经授权的错误,因为Visual Studio尝试传递匿名身份验证凭据,并且失败。

Is there a way that we can update these references with the current configuration? 有没有一种方法可以用当前配置更新这些引用? I have access to the server & can temporarily switch on anonymous authentication, but not all our developers will be able to do so. 我可以访问服务器,并且可以暂时打开匿名身份验证,但并非我们所有的开发人员都可以这样做。 I'd have expected Visual Studio to provide a prompt for credentials, but this does not seem to be the case... 我曾希望Visual Studio提供提示输入凭据的方法,但事实并非如此……

So the error I was given did not reflect the underlying cause. 因此,给出的错误并未反映出根本原因。 The service I was attempting to update a reference for, had something go wrong during its deployment. 我尝试为其更新参考的服务在部署期间出了点问题。 This lead to the .svc file not making it onto the server. 这导致.svc文件无法放入服务器。

While I expected this to result in a 404 error, rather a 401 was returned. 虽然我希望这会导致404错误,但返回了401。 Once we had redeployed the service, I was able to update the service reference with windows authentication turned on. 一旦我们重新部署了服务,就可以在Windows身份验证打开的情况下更新服务引用。 Go figure... 去搞清楚...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将文件字节流发送到WCF服务时,为什么会出现“ 401-未经授权”错误? - Why am I getting a “401 - Unauthorized” error when sending a file byte stream to a WCF service? 从另一个WCF服务调用时,WCF Web服务IIS6 401未授权错误。 从asmx / WinForms调用可以 - WCF web service IIS6 401 unauthorized error when calling from another WCF service. Calling from asmx/WinForms is OK 在IIS上尝试我的WCF数据服务时得到“401 - 未经授权” - Got a “401 - Unauthorized” when trying my WCF Data service on IIS Web服务401未经授权的错误 - Web service 401 Unauthorized error Web服务401:未经授权的错误 - Web Service 401: Unauthorized Error 在Silverlight项目中更新WCF服务参考时出错 - Error updating WCF service reference in silverlight project WCF错误401仅在某些PC上未经授权 - WCF Error 401 Unauthorized only on some pcs 引用Dll时未经授权的WCF(401) - WCF (401) Unauthorized When Referencing Dll 使用基本身份验证调试本地WCF服务始终返回401-未经授权 - Debug local WCF service with Basic Authentication always returns 401 - Unauthorized WCF Rest 自托管证书安全服务返回 401 未经授权 - WCF Rest self hosted certificate secured service returns 401 unauthorized
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM