简体   繁体   English

没有频道积极收听

[英]There was no channel actively listening

maybe you can help me set up my WCF service. 也许您可以帮助我设置WCF服务。

First, here is my config file: 首先,这是我的配置文件:

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

And this is how I call my service from c#: 这就是我从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();

It worked fine when I was doing this on localhost but now it keeps telling me no endpoint was found. 当我在localhost上执行此操作时,它工作正常,但现在它一直告诉我未找到端点。

Also, the server generated the following error: 此外,服务器生成以下错误:

System.ServiceModel.EndpointNotFoundException: There was no channel actively listening at 'http://myURL/auth.svc/$metadata'. System.ServiceModel.EndpointNotFoundException:没有通道正在主动监听“ http://myURL/auth.svc/$metadata”。 This is often caused by an incorrect address URI. 这通常是由不正确的地址URI引起的。 Ensure that the address to which the message is sent matches an address on which a service is listening. 确保将消息发送到的地址与正在侦听服务的地址匹配。

Im really confused, I have no idea why this is happening. 我真的很困惑,我不知道为什么会这样。 Do I need to create another service file for the metadata exchange? 我需要为元数据交换创建另一个服务文件吗?

Do I need to set a baseAddress? 我需要设置baseAddress吗?

Thanks 谢谢

How did you deploy the service? 您是如何部署服务的? I assume the service is running in IIS on your box - did you try hitting the service URL (http://myUrl/auth.svc) in a browser to see if it is indeed up? 我认为该服务正在您的盒子上的IIS中运行-您是否尝试在浏览器中点击服务URL(http://myUrl/auth.svc)以查看其是否确实启动了?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM