3

我正在制作 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. 

什么可能是问题的原因?

我的网络配置:

<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>
4

2 回答 2

0

如果您在 MVC 应用程序中托管此服务,请确保添加以下行以忽略控制器路由冲突,我在挣扎了一段时间后遇到了这个问题,我发现这个答案已经解决了这个问题。

routes.IgnoreRoute("{ allsvc}", new { allsvc = @"..svc (/.*)?" });

于 2014-05-20T21:27:14.397 回答
0

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

于 2012-06-24T14:26:03.730 回答