gpt4 book ai didi

WCF 部署到 IIS 6 导致 403 权限错误

转载 作者:行者123 更新时间:2023-12-03 20:19:43 30 4
gpt4 key购买 nike

我以前从未将 WCF 服务部署到 IIS 6。我有一个服务,我通过使用默认配置作为 WCF 项目的一部分部署到 IIS 6。从那以后,我简化了可能是问题的配置思路。如果我在浏览器中浏览到该服务,则会出现以下错误:

HTTP Error 403.1 - Forbidden: Execute access is denied.



我的配置现在看起来像这样:
<system.serviceModel>
<services>
<service name="MyCompany.WebServices.MyService">
<endpoint address="" binding="basicHttpBinding" contract="MyCompany.WebServices.IMyService" />
</service>
</services>
</system.serviceModel>

如果我尝试将它添加为 ASP.NET MVC 中的引用,我会得到以下信息:

There was an error downloading 'http://ws.mycompany.com/MyService.svc'. The request failed with HTTP status 403: Forbidden. Metadata contains a reference that cannot be resolved: 'http://ws.mycompany.com/MyService.svc'. The HTTP request was forbidden with client authentication scheme 'Anonymous'. The remote server returned an error: (403) Forbidden. If the service is defined in the current solution, try building the solution and adding the service reference again.



任何想法可能会发生什么?

更新:

这似乎是我的 IIS 6 机器上的配置问题。我认为这是因为我创建了一个全新的 ASP.NET 3.5 WCF 应用程序并将其部署到一个新的 URL http://ws.unitedoneresources.com/Service1.svc .如果我尝试调用该服务,则会收到上面列出的相同 HTTP 错误。整个服务配置如下:
  <system.serviceModel>
<services>
<service name="WcfService1.Service1" behaviorConfiguration="WcfService1.Service1Behavior">
<!-- Service Endpoints -->
<endpoint address="" binding="wsHttpBinding" contract="WcfService1.IService1">
<!--
Upon deployment, the following identity element should be removed or replaced to reflect the
identity under which the deployed service runs. If removed, WCF will infer an appropriate identity
automatically.
-->
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="WcfService1.Service1Behavior">
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>

同样,这是一个全新的 ASP.NET 3.5 WCF 应用程序,所以我没有对项目本身进行任何修改。

最佳答案

我搞砸了我搞砸了网站,在 IIS 6 上安装了 WCF(在命令提示符下使用 ServiceModelReg.exe/i/x),然后重新部署。有效!

谢谢!

关于WCF 部署到 IIS 6 导致 403 权限错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2299736/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com