配置 WCF 服务以在 IIS 6 上运行

发布于 2024-11-13 07:45:23 字数 2314 浏览 2 评论 0原文

部署到生产环境后,我只收到 404 - 文件未找到。

该服务需要配置为虚拟目录 ( /v1 )。 它有自己的应用程序池。

我按照 http://www.jamesgoodfellow.com/blog/post/IIS-60---HTTP-404---File-not-found-Internet-Information-Services.aspx

我添加了狂野卡并删除了 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

夏夜暖风 2024-11-20 07:45:23

事实证明,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.

勿忘初心 2024-11-20 07:45:23

看到了同样的问题,但对我来说这是因为 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文