【问题标题】:Can not access .net wcf service on the Apache (mono)无法访问 Apache 上的 .net wcf 服务(单声道)
【发布时间】:2017-11-24 18:06:30
【问题描述】:

我有简单的 .net wcf 服务,可在 Apache 和 mod-mono 上运行。 如果我访问像 https://localhost/Myservice.svc 这样的服务,它可以正常工作,但是如果我像 https://my.server.net/Myservice.svc 那样访问(即使是从同一台计算机),即使我尝试从服务请求 wsdl,我也会看到异常

应用程序异常

System.InvalidOperationException
HttpListenerContext does not match any of the registered channels

Description: HTTP 500.Error processing request.

Details: Non-web exception. Exception origin (name of application or object): System.ServiceModel.
Exception stack trace: at 
System.ServiceModel.Channels.Http.HttpListenerManager.ProcessNewContext (System.ServiceModel.Channels.Http.HttpContextInfo ctxi) [0x0000e] in <e281f37e433a4b9291b04f8a9c25b68f>:0 at System.ServiceModel.Channels.SvcHttpHandler.ProcessRequest (System.Web.HttpContext context) [0x00060] in <e281f37e433a4b9291b04f8a9c25b68f>:0 at System.Web.HttpApplication+<Pipeline>c__Iterator1.MoveNext () [0x00dd7] in <d3ba84a338d241e2ab5397407351c9cd>:0 at System.Web.HttpApplication.Tick () [0x00000] in <d3ba84a338d241e2ab5397407351c9cd>:0 Version Information: 4.6.1 (tarball Fri Oct 21 13:04:27 CEST 2016); ASP.NET Version: 4.0.30319.42000 Powered by Mono

【问题讨论】:

  • 那么,您的问题是什么?到目前为止,您尝试过什么?
  • @GrayCygnus 我的问题是如何为完全限定的 dns 名称运行我的服务并避免此异常。这是 apache 配置的问题还是我的应用程序的问题?我在 IIS 中检查了我的服务,它工作正常。我什至不知道我可以尝试改变什么。

标签: .net apache wcf mono mod-mono


【解决方案1】:

Web.config 中的更改

<serviceHostingEnvironment multipleSiteBindingsEnabled="false" />

还有

<endpoint address="http://server.com/"

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-07-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-12-01
    相关资源
    最近更新 更多