配置 WCF 服务以在 IIS 6 上运行
部署到生产环境后,我只收到 404 - 文件未找到。
该服务需要配置为虚拟目录 ( /v1 )。 它有自己的应用程序池。
我添加了狂野卡并删除了 Windows 集成安全性,按照 hosting .net IIS 6 中的 4.0 REST WCF 服务
它仍然无法工作...
这是我的 web.config 的 ServiceModel 部分:
<system.serviceModel>
<extensions>
<behaviorExtensions>
<add name="restHttpBehavior" type="--hidden for security purposes--, Version=0.8.0.0, Culture=neutral, PublicKeyToken=null"/>
</behaviorExtensions>
</extensions>
<services>
<service name="--hidden for security purposes--" behaviorConfiguration="MetadataBehavior">
<host>
<baseAddresses>
<add baseAddress="http://localhost/v1/api.svc"/>
</baseAddresses>
</host>
<endpoint behaviorConfiguration="WebBehavior" binding="webHttpBinding" bindingConfiguration="restNoSSL" contract="--hidden for security purposes--"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="WebBehavior">
<restHttpBehavior/>
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="MetadataBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<webHttpBinding>
<binding name="restNoSSL">
</binding>
</webHttpBinding>
</bindings>
</system.serviceModel>
请帮助!
After deploying to production env' I receive only 404 - File Not Found.
The service needs to be configured as a virtual directory ( /v1 ).
It has its own Application pool.
I enabled ASP .Net 4.0 as per http://www.jamesgoodfellow.com/blog/post/IIS-60---HTTP-404---File-not-found-Internet-Information-Services.aspx
I added the wild card and removed windows integrated security as per hosting .net 4.0 REST WCF service in IIS 6
It still doesn't work...
Here's the ServiceModel part of my web.config:
<system.serviceModel>
<extensions>
<behaviorExtensions>
<add name="restHttpBehavior" type="--hidden for security purposes--, Version=0.8.0.0, Culture=neutral, PublicKeyToken=null"/>
</behaviorExtensions>
</extensions>
<services>
<service name="--hidden for security purposes--" behaviorConfiguration="MetadataBehavior">
<host>
<baseAddresses>
<add baseAddress="http://localhost/v1/api.svc"/>
</baseAddresses>
</host>
<endpoint behaviorConfiguration="WebBehavior" binding="webHttpBinding" bindingConfiguration="restNoSSL" contract="--hidden for security purposes--"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="WebBehavior">
<restHttpBehavior/>
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="MetadataBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<webHttpBinding>
<binding name="restNoSSL">
</binding>
</webHttpBinding>
</bindings>
</system.serviceModel>
Please Help!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
事实证明,ISAPI 过滤器实际上阻止了该服务。所以我删除了通配符,添加了 Windows 集成安全性 - 现在网站可以正常工作了。
Turns out that the ISAPI filter was actually blocking the service. So I removed the wildcard, added back windows integrated security - and the website now works.
看到了同样的问题,但对我来说这是因为 ISAPI 通配符使用了不正确的 ISAPI 文件。
这些版本存在
64位.net 2.0 aspnet_isapi.dll
32位.net
2.0 aspnet_isapi.dll 64位.net 4.0 aspnet_isapi.dll
32位.net 4.0 aspnet_isapi.dll
32位.net 4.0 aspnet_isapi.dll可以应用并且仍然允许我的网站工作。
Saw the same issue but for me it was because the ISAPI wildcard was using the incorrect ISAPI file.
these versions exist
64bit .net 2.0 aspnet_isapi.dll
32bit .net 2.0 aspnet_isapi.dll
64bit .net 4.0 aspnet_isapi.dll
32bit .net 4.0 aspnet_isapi.dll
32 bit .net 4.0 aspnet_isapi.dll could be applied and still allow my site to work.