我正在制作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.
问题可能是什么原因?
我的网站.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>
答案 0 :(得分:0)
验证在应用程序的ASP.NET选项卡(在IIS中)中选择的.NET框架的正确版本
答案 1 :(得分:0)
如果您在MVC应用程序中托管此服务,请确保添加以下行以忽略控制器路由冲突,我在经过一段时间的努力后遇到此问题我发现此答案已解决了该问题。
routes.IgnoreRoute(“{ allsvc}”,new {allsvc = @“。 .svc(/.*)?”});