Search code examples
c#wcfexceptionwcf-configuration

Getting EndpointNotFoundException: There was no channel actively listening in WCF


I have created a WCF multiservice with two interfaces, i'm trying to export two endpoints one for each service. Here below you can see the two endpoints:

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

when i try to call the service i have and error telling me that the endpoint is not found.

[EndpointNotFoundException]: There was no channel actively listening at 'http://localhost:3197/SAGBService.svc/GetRapportTrimestiel/0/0/0/20150401/20150430&#39;. This is often caused by an incorrect address URI. Ensure that the address to which the message is sent matches an address on which a service is listening.

but when i remove the second endpoint, it works can access the functions on ICalculeLactation:

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

the problem is that i'm interested in the fuctions that are on ISAGBService


Solution

  • I think the error says it: This is often caused by an incorrect address URI

    Your endpoint has the address of "basic1", but the URL request does not include that address. http://localhost:3197/SAGBService.svc/GetRapportTrimestiel/0/0/0/20150401/20150430

    vs

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