【问题标题】:Getting EndpointNotFoundException: There was no channel actively listening in WCF获取 EndpointNotFoundException:WCF 中没有主动监听的通道
【发布时间】:2017-05-12 18:08:34
【问题描述】:

我创建了一个具有两个接口的 WCF 多服务,我正在尝试为每个服务导出两个端点。 您可以在下面看到两个端点:

<service behaviorConfiguration="SAGBService_Behavior" name="SAGBService.SAGBService">
    <endpoint address="basic" binding="webHttpBinding" bindingConfiguration=""
      contract="SAGBService.ICalculeLactation" />
    <endpoint address="basic1" binding="webHttpBinding" bindingConfiguration=""
      contract="SAGBService.ISAGBService" />
  </service>

当我尝试调用我拥有的服务并告诉我找不到端点时出错。

[EndpointNotFoundException]:没有通道主动监听 在'http://localhost:3197/SAGBService.svc/GetRapportTrimestiel/0/0/0/20150401/20150430&#39;。这是 通常是由不正确的地址 URI 引起的。确保地址为 发送消息的地址与服务所在的地址匹配 听。

但是当我删除第二个端点时,它可以访问 ICalculeLactation 上的函数:

<service behaviorConfiguration="SAGBService_Behavior" name="SAGBService.SAGBService">
    <endpoint address="" binding="webHttpBinding" bindingConfiguration=""
      contract="SAGBService.ICalculeLactation" />
  </service>

问题是我对正在运行的功能感兴趣 ISAGB服务

【问题讨论】:

  • 一个服务有两个端点,尝试在不同的服务中使用它们,或者可能对所有功能使用相同的合同。
  • ICalculeLactation 真的提供了与乳腺分泌乳汁相关的计算接口吗?

标签: c# wcf exception-handling wcf-configuration


【解决方案1】:

我认为错误说明了它:This is often caused by an incorrect address URI

您的端点的地址为“basic1”,但 URL 请求不包含该地址。 http://localhost:3197/SAGBService.svc/GetRapportTrimestiel/0/0/0/20150401/20150430

http://localhost:3197/SAGBService.svc/basic1/GetRapportTrimestiel/0/0/0/20150401/20150430

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-01
    • 2019-12-04
    • 1970-01-01
    • 1970-01-01
    • 2020-12-06
    相关资源
    最近更新 更多