[英]There was no channel actively listening
也許您可以幫助我設置WCF服務。
首先,這是我的配置文件:
<system.serviceModel>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<bindings />
<services>
<service name="AuthenticatorService.Authenticator">
<endpoint address="auth" binding="basicHttpBinding" bindingConfiguration=""
name="AuthEndpoint" contract="AuthInterface.IAuthenticator" />
<endpoint address="mex" binding="mexHttpBinding" name="MetadataEndpoint"
contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="True" />
<serviceDebug includeExceptionDetailInFaults="True" />
</behavior>
</serviceBehaviors>
</behaviors>
這就是我從c#調用服務的方式:
//This creates a link to the WCF service using basicHttpBingind
httpFactory = new ChannelFactory<IAuthenticator>(new BasicHttpBinding(), new EndpointAddress("http://myUrl/auth.svc"));
httpProxy = httpFactory.CreateChannel();
當我在localhost上執行此操作時,它工作正常,但現在它一直告訴我未找到端點。
此外,服務器生成以下錯誤:
System.ServiceModel.EndpointNotFoundException:沒有通道正在主動監聽“ http://myURL/auth.svc/$metadata”。 這通常是由不正確的地址URI引起的。 確保將消息發送到的地址與正在偵聽服務的地址匹配。
我真的很困惑,我不知道為什么會這樣。 我需要為元數據交換創建另一個服務文件嗎?
我需要設置baseAddress嗎?
謝謝
您是如何部署服務的? 我認為該服務正在您的盒子上的IIS中運行-您是否嘗試在瀏覽器中點擊服務URL(http://myUrl/auth.svc)以查看其是否確實啟動了?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.