2017-06-21 54 views
0

我有簡單的.net wcf服務,它可以在Apache和mod-mono上運行。 如果我訪問服務像https://localhost/Myservice.svc它工作正常,但如果我訪問諸如https://my.server.net/Myservice.svc(甚至是同一臺計算機),我看到例外,甚至我嘗試從服務無法訪問Apache上的.net wcf服務(單聲道)

應用程序異常

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 
+0

那麼,你的問題是什麼?你試過什麼了? – DarkCygnus

+0

@GrayCygnus 我的問題是如何運行我的服務完全合格的DNS名稱,並避免此例外。 這個問題的Apache配置或我的應用程序的問題? 我在IIS中檢查了我的服務,它工作正常。我甚至不知道我可以嘗試改變。 –

回答

0

變化要求WSDL在Web.config

<serviceHostingEnvironment multipleSiteBindingsEnabled="false" /> 

而且

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