【问题标题】:SOAP web service in MVC - The controller for path was not found or does not implement IControllerMVC 中的 SOAP Web 服务 - 找不到路径控制器或未实现 IController
【发布时间】:2013-08-30 09:09:28
【问题描述】:

我们有一个位于 [website]/Api/HmlApi.svc/soap 的 Web 服务,它通常可以正常工作。它不是 SSL。

在这个特定站点中,我们可以在浏览器中正常查看 .svc 页面,但尝试访问此服务的客户端应用程序会收到 http 404 错误。未找到端点。

网站的配置如下。

<system.serviceModel>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true">
</serviceHostingEnvironment>
<!--Set up the service-->
<services>
  <service behaviorConfiguration="SOAPRESTDemoBehavior" name="HmlApi">        
    <endpoint address="soap" binding="basicHttpBinding" contract="VLSCore2.Interfaces.IHmlApi" />
  </service>
</services>
<!--Define the behaviours-->
<behaviors>
  <serviceBehaviors>
    <behavior name="SOAPRESTDemoBehavior">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="true" />
    </behavior>
  </serviceBehaviors>
  <endpointBehaviors>
    <behavior name="SOAPRESTDemoEndpointBehavior">
      <webHttp />
    </behavior>
  </endpointBehaviors>
</behaviors>

网站登录出现如下错误:

/Api/Hmlapi.svc/soap - The controller for path was not found or does not implement IController

这对我来说表明 url 是正确的 - 我们正在访问站点,我们可以访问 svc,但不知何故,它并没有像上面配置中的正常设置那样路由到 soap 端点。

关于为什么在这个网站的情况下它可能不起作用的任何想法?还有什么我们可以检查的吗?

【问题讨论】:

  • 您的路由是否处理您网址中的.

标签: c# asp.net asp.net-mvc web-services soap


【解决方案1】:

确保您已正确配置 WebApi 路由配置。您可以将它们放在 Global.asax.cs 中,或者如果您在 MVC4 或 MVC5 项目中,则在 App_Start 文件夹 WebApiConfig.cs 中。

如果你正确配置了路由,那么你是否将服务配置放入正确的配置文件中?

您好!

【讨论】:

    猜你喜欢
    • 2012-12-10
    • 2013-05-31
    • 1970-01-01
    • 2016-11-26
    • 1970-01-01
    • 2020-07-20
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多