c# - MVC 中的 SOAP Web 服务 - 找不到路径 Controller 或未实现 IController

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

我们有一个位于 [website]/Api/HmlApi.svc/soap 的网络服务,它通常工作正常。它不是 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 端点。

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

最佳答案

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

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

您好!

关于c# - MVC 中的 SOAP Web 服务 - 找不到路径 Controller 或未实现 IController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18468502/

相关文章:

asp.net-mvc - 根据条件渲染局部 View

c# - .Net 不可用 "Extension Property"之类的功能

asp.net - Visual Studio 调试错误无法启动程序没有更多文件

c# - c# 中的 Baby-Step Giant Step 算法。哈希表内存不足

c# - 随机获取显示数据到下拉列表

asp.net - Google(搜索引擎)针对 ASP.NET 页面的索引建议

c# - ASP.NET MVC 中的 DRY - 详细信息显示与编辑表单

asp.net-mvc - ASP.NET MVC : Partial view to show part of a table

c# - 链接 : warning AL1073: Referenced assembly 'mscorlib.dll' targets a different processor

c# - C# 中是否有 "true or throw"或 "non-null or throw"表达式?