C#C
C#6mo ago
VoidPointer

AmbiguousMatchException: The request matched multiple endpoints

I'm running two APIs, KYC and Integration, with some endpoints that have the same url path, e.g. api/ProviderServices/GetSarsTaxComplianceStatus, but they have different url host addresses, i.e. KYC is http://localhost:56101 and Integration is http://localhost:5001.

Yet when I call the Integration endpoint, http://localhost:5001/api/ProviderServices/GetSarsTaxComplianceStatus, from Postman, I get this exception:
Microsoft.AspNetCore.Routing.Matching.AmbiguousMatchException: The request matched multiple endpoints. Matches: 

API.Gateway.Integration.Controllers.ProviderServicesController.GetSarsTaxComplianceStatus (API.Gateway.Integration)
Kyc.Api.Controllers.ProviderServicesController.GetSarsTaxComplianceStatus (Kyc.Api)

But if I call the KYC endpoint, http://localhost:56101/api/ProviderServices/GetSarsTaxComplianceStatus, I get a valid response.

This vaguely suggests to me that something is dodgy with the routing in the Integration project, but I really have no clue how this happened, as just yesterday, I was successfully calling ProviderServices/GetSarsTaxComplianceStatus in both services without a problem.
Was this page helpful?