我从未将WCF服务部署到IIS 6之前。我有一个服务,我使用默认配置作为WCF项目的一部分,部署到IIS 6。我自从简化了可能是问题的配置思路。以下是错误我越来越如果我浏览到该服务在浏览器中:WCF部署到IIS 6导致403权限错误
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应用程序,所以我没有修改对项目本身的东西。
服务托管在您查询的同一台计算机上吗? – Jeff 2010-02-19 22:25:54
不是。一个是数据库服务器,另一个是IIS服务器。数据库调用都在使用EF的类库内部处理。 – 2010-02-22 01:37:38
我已更新上述问题。我已经尝试设置IIS网站具有执行权限,重新启动IIS,并且不起作用。我也试过这个在IIS7框上无济于事。这一定是我做错了。 – 2010-02-22 16:06:34