web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Odata not working

(1) ShareShare
ReportReport
Posted on by 484
Hi,
 
When calling odata to get customers
I get this error (400 bad request)
Exception message: Ambiguous match found 
Exception type: system.Reflection.AmbigiousMatchException
 
However, when i change the url to another devBox it works fine...what could be wrong
 
The odata url  i'm calling is correct and i'm getting the token successfully as well. Because as i said when i change the environment url it works directly and return customers. The issue is just in my devBox
 
Here's the full error
{ "Message": "An error has occurred.", "ExceptionMessage": "Ambiguous match found.", "ExceptionType": "System.Reflection.AmbiguousMatchException", "StackTrace": " at System.RuntimeType.GetMethodImpl(String name, BindingFlags bindingAttr, Binder binder, CallingConventions callConv, Type[] types, ParameterModifier[] modifiers)\r\n at System.Type.GetMethod(String name, BindingFlags bindingAttr)\r\n at Microsoft.Dynamics.Platform.Integration.Services.OData.Metadata.ODataAction.get_Method()\r\n at Microsoft.Dynamics.Platform.Integration.Services.OData.Metadata.MetadataModelBuilder.ValidateActionMetadata(IActionMetadata action, EntityType entityType)\r\n at Microsoft.Dynamics.Platform.Integration.Services.OData.Metadata.MetadataModelBuilder.BuildAction(EntityType entityType, IActionMetadata action)\r\n at Microsoft.Dynamics.Platform.Integration.Services.OData.Metadata.MetadataModelBuilder.BuildActions(IEnumerable`1 resources)\r\n at Microsoft.Dynamics.Platform.Integration.Services.OData.Metadata.MetadataModelBuilder..ctor()\r\n at Microsoft.Dynamics.Platform.Integration.Services.OData.Metadata.MetadataModelBuilder.InitializeInstance()\r\n at Microsoft.Dynamics.Platform.Integration.Services.OData.Metadata.MetadataModelBuilder.get_Instance()\r\n at Microsoft.Dynamics.Platform.Integration.Services.OData.Metadata.EdmModelProxy.get_EntityContainer()\r\n at Microsoft.OData.Edm.ExtensionMethods.FindDeclaredEntitySet(IEdmModel model, String qualifiedName)\r\n at Microsoft.OData.Core.UriParser.Metadata.ODataUriResolver.ResolveNavigationSource(IEdmModel model, String identifier)\r\n at Microsoft.OData.Core.UriParser.Parsers.ODataPathParser.TryCreateSegmentForNavigationSource(String identifier, String parenthesisExpression)\r\n at Microsoft.OData.Core.UriParser.Parsers.ODataPathParser.CreateFirstSegment(String segmentText)\r\n at Microsoft.OData.Core.UriParser.Parsers.ODataPathParser.ParsePath(ICollection`1 segments)\r\n at Microsoft.OData.Core.UriParser.Parsers.ODataPathFactory.BindPath(ICollection`1 segments, ODataUriParserConfiguration configuration)\r\n at Microsoft.OData.Core.UriParser.ODataUriParser.Initialize()\r\n at System.Web.OData.Routing.DefaultODataPathHandler.Parse(IEdmModel model, String serviceRoot, String odataPath, ODataUriResolverSetttings resolverSettings, Boolean enableUriTemplateParsing)\r\n at System.Web.OData.Routing.DefaultODataPathHandler.Parse(IEdmModel model, String serviceRoot, String odataPath)\r\n at System.Web.OData.Routing.ODataPathRouteConstraint.Match(HttpRequestMessage request, IHttpRoute route, String parameterName, IDictionary`2 values, HttpRouteDirection routeDirection)\r\n at Microsoft.Dynamics.Platform.Integration.Services.Controllers.AxODataPathRouteConstraint.Match(HttpRequestMessage request, IHttpRoute route, String parameterName, IDictionary`2 values, HttpRouteDirection routeDirection)\r\n at System.Web.Http.Routing.HttpRoute.ProcessConstraint(HttpRequestMessage request, Object constraint, String parameterName, HttpRouteValueDictionary values, HttpRouteDirection routeDirection)\r\n at System.Web.Http.Routing.HttpRoute.ProcessConstraints(HttpRequestMessage request, HttpRouteValueDictionary values, HttpRouteDirection routeDirection)\r\n at System.Web.Http.Routing.HttpRoute.GetRouteData(String virtualPathRoot, HttpRequestMessage request)\r\n at Microsoft.Dynamics.Platform.Integration.Services.Controllers.AxODataRoute.GetRouteData(String virtualPathRoot, HttpRequestMessage request)\r\n at System.Web.Http.HttpRouteCollection.GetRouteData(HttpRequestMessage request)\r\n at System.Web.Http.Dispatcher.HttpRoutingDispatcher.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\r\n at System.Net.Http.DelegatingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\r\n at System.Web.Http.Tracing.Tracers.RequestMessageHandlerTracer.<>c__DisplayClass4.<SendAsync>b__1()\r\n at System.Web.Http.Tracing.ITraceWriterExtensions.TraceBeginEndAsync[TResult](ITraceWriter traceWriter, HttpRequestMessage request, String category, TraceLevel level, String operatorName, String operationName, Action`1 beginTrace, Func`1 execute, Action`2 endTrace, Action`1 errorTrace)\r\n at System.Web.Http.Tracing.Tracers.RequestMessageHandlerTracer.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\r\n at System.Net.Http.DelegatingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\r\n at System.Web.Http.HttpServer.<SendAsync>d__0.MoveNext()" }
I have the same question (0)
  • Martin Dráb Profile Picture
    237,967 Most Valuable Professional on at
    Please show us your OData query and tell us which HTTP method (e.g. GET) you're using.

    The fact that it works in another environment may be caused by different data, because the result of an OData command obviously depends on the data.
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    26,436 Super User 2025 Season 2 on at
    Hi,
     
     
    I think you must perform synchro in your DevBox.
     
    Best regards,
    Mohamed Amine MAHMOUDI
  • DELDYN Profile Picture
    484 on at
    Hi Martin,
     
    It's a simple get url without any filtering 
    Url/data/CustomersV3
     
    Even if in the browser i put "url/data" i get the same error
     
    Mohammed, i already did sync but same thing. Maybe i could give it another try
  • Martin Dráb Profile Picture
    237,967 Most Valuable Professional on at
    It seems that it fails when it try to find an OData action. Think about when it stopped working and check code changes since then, especially if any OData actions hasn't been added or changed or data entities moved between models).
     
    If the problem is on your dev box and not others', it likely means that the problem is caused by a wrong state of your dev box. First of all, compile the application. Then either review your local changes or remove them (to get a known state defined by source control).

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 451 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 428 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans