Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

Odata not working

(1) ShareShare
ReportReport
Posted on by 304
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()" }
  • Martin Dráb Profile Picture
    Martin Dráb 230,370 Most Valuable Professional on at
    Odata not working
    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).
  • DELDYN Profile Picture
    DELDYN 304 on at
    Odata not working
    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
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    Mohamed Amine Mahmoudi 9,738 Super User 2024 Season 2 on at
    Odata not working
    Hi,
     
     
    I think you must perform synchro in your DevBox.
     
    Best regards,
    Mohamed Amine MAHMOUDI
  • Martin Dráb Profile Picture
    Martin Dráb 230,370 Most Valuable Professional on at
    Odata not working
    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.

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

News and Announcements

Announcing Category Subscriptions!

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,359 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans