gpt4 book ai didi

wcf - 在 IIS 上托管 WCF 服务(找不到资源)

转载 作者:行者123 更新时间:2023-12-05 08:01:53 25 4
gpt4 key购买 nike

我正在制作 WFC 服务。当我从 Visual Studio 调试它时一切正常,但是当我在真正的 IIS 上部署它时我遇到了问题。

部署后我仍然可以获得 WSDL,但是当我请求 WebGet 方法(它返回一个简单的 XML 文档)方法时,我收到以下错误:

The resource cannot be found.

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

问题的原因是什么?

我的 Web.Config:

<system.serviceModel>
<services>
<service name="XXXX.TSDX.UI.TsdxService">
<endpoint
address="Tsdx"
binding="webHttpBinding"
bindingConfiguration="TestBinding"
behaviorConfiguration="RESTFriendly"
contract="XXXX.TSDX.UI.ITsdxService" />
</service>
</services>
<bindings>
<webHttpBinding>
<binding name="TestBinding" />
</webHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="RESTFriendly">
<webHttp />
</behavior>
</endpointBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>

最佳答案

验证是否在 ASP.NET 选项卡(在 IIS 中)中为您的应用程序选择了正确的 .NET 框架版本

关于wcf - 在 IIS 上托管 WCF 服务(找不到资源),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11178111/

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