Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Unanswered

oDataV4 API calls

(0) ShareShare
ReportReport
Posted on by

After converting BC18 to Business Central API pages are not working anymore. Within Business Central the pages are working but the external API calls fail. Retreiving a list of API's is in error. I added the tracelog.

Version: NL Business Central 20.0 (platform 20.0.37114.38150 + 20.0.37253.38230)

localhost:7213/TEST200/ODataV4
localhost:7213/TEST200/ODataV4
{
  /error/: {
    /code/: /BadRequest_NotSupported/,
    /message/: /None/
  }
}

 
Please advice.
 
Server instance: TEST200
Category: Runtime
ClientSessionId: 5a8db0dc-8681-4c45-8654-2f80e05321e7
ClientActivityId: 3465676f-c3a2-4b82-8d85-b3cc4aee092f
ServerSessionUniqueId: 0e813152-59b5-40c0-bdec-56d4ac3096f1
ServerActivityId: d5ea9321-26c5-488f-88c9-7d78dafc78b5
EventTime: 08/07/2023 07:50:42
Message (NavODataNotSupportedException): RootException: NavODataNotSupportedException
None
ExceptionStackTrace:
   at Microsoft.Dynamics.Nav.Service.OData.V4.NavTypeExtensions.GetEdmPrimitiveTypeKind(NavType value)
   at Microsoft.Dynamics.Nav.Service.OData.V4.NavEdmPrimitivePropertyMetadataExtensions.GetEdmTypeReference(INavEdmPrimitivePropertyMetadata metadata)
   at Microsoft.Dynamics.Nav.Service.OData.V4.Modeling.NavEdmModelAddEntitiesStrategy.Apply(INavEdmModel navEdmModel, EdmModel model)
   at Microsoft.Dynamics.Nav.Service.OData.V4.Modeling.NavEdmModelStrategies`1.Apply(INavEdmModel navEdmModel, T model)
   at Microsoft.Dynamics.Nav.Service.OData.V4.NavODataV4V1CachedModelBuilder.Build(IEnumerable`1 complexTypes, IEnumerable`1 services)
   at Microsoft.Dynamics.Nav.Service.OData.NavServiceBase.Execute[TResult](HttpRequest request, NavSession session, Func`2 operation, OpenCompanyDetails openCompanyDetails)
   at Microsoft.Dynamics.Nav.Service.OData.NavServiceBase.Execute[TResult](Func`2 operation)
   at Microsoft.Dynamics.Nav.Service.OData.Modeling.NavODataCachedModelBuilder`2.Build(INavServiceEnvironment serviceEnvironment)
   at Microsoft.Dynamics.Nav.Service.OData.V4.NavODataV4RouteBuilder.GetEdmModelWithLogging(IServiceProvider serviceProvider)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScopeCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass2_0.<RealizeService>b__0(ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
   at Microsoft.AspNet.OData.Routing.DefaultODataPathHandler.Parse(String serviceRoot, String odataPath, IServiceProvider requestContainer, Boolean template)
   at Microsoft.AspNet.OData.Routing.DefaultODataPathHandler.Parse(String serviceRoot, String odataPath, IServiceProvider requestContainer)
   at Microsoft.Dynamics.Nav.Service.OData.V4.NavODataV4PathHandler.Parse(String serviceRoot, String odataPath, IServiceProvider requestContainer)
   at Microsoft.Dynamics.Nav.Service.OData.V4.NavODataV4RouteConstraint.GetODataPath(String oDataPathString, String uriPathString, String queryString, HttpRequest request, String routeName, Func`1 requestContainerFactory, String& serviceRoot)
   at Microsoft.Dynamics.Nav.Service.OData.V4.NavODataV4RouteConstraint.Match(HttpContext httpContext, IRouter route, String routeKey, RouteValueDictionary values, RouteDirection routeDirection)
   at Microsoft.AspNetCore.Routing.RouteConstraintMatcher.Match(IDictionary`2 constraints, RouteValueDictionary routeValues, HttpContext httpContext, IRouter route, RouteDirection routeDirection, ILogger logger)
   at Microsoft.AspNetCore.Routing.RouteBase.RouteAsync(RouteContext context)
   at Microsoft.AspNetCore.Routing.RouteCollection.<RouteAsync>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Builder.RouterMiddleware.<Invoke>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Dynamics.Nav.Service.OData.NavODataExceptionHandlingMiddleware.<InvokeAsync>d__1.MoveNext()
CallerStackTrace:
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at Microsoft.Dynamics.Nav.Service.OData.NavODataExceptionHandlingMiddleware.InvokeAsync(HttpContext context)
   at Microsoft.AspNet.OData.Batch.ODataBatchMiddleware.<Invoke>d__2.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at Microsoft.AspNet.OData.Batch.ODataBatchMiddleware.Invoke(HttpContext context)
   at Microsoft.Dynamics.Nav.Service.OData.NavODataCorsMiddleware.<InvokeAsync>d__1.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at Microsoft.Dynamics.Nav.Service.OData.NavODataCorsMiddleware.InvokeAsync(HttpContext context)
   at Microsoft.Dynamics.Nav.Service.OData.NavODataRequestThrottlingMiddleware.<InvokeAsync>d__2.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at Microsoft.Dynamics.Nav.Service.OData.NavODataRequestThrottlingMiddleware.InvokeAsync(HttpContext context)
   at Microsoft.Dynamics.Nav.Service.OData.NavODataRequestStatisticsMiddleware.<InvokeAsync>d__1.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at Microsoft.Dynamics.Nav.Service.OData.NavODataRequestStatisticsMiddleware.InvokeAsync(HttpContext context)
   at Microsoft.Dynamics.Nav.Service.OData.NavODataMaxConnectionsMiddleware.<InvokeAsync>d__1.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at Microsoft.Dynamics.Nav.Service.OData.NavODataMaxConnectionsMiddleware.InvokeAsync(HttpContext context)
   at Microsoft.Dynamics.Nav.Service.OData.NavODataOptionsPreflightMiddleware.<InvokeAsync>d__3.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at Microsoft.Dynamics.Nav.Service.OData.NavODataOptionsPreflightMiddleware.InvokeAsync(HttpContext context)
   at Microsoft.Dynamics.Nav.Service.OData.NavODataRequestCompressionMiddleware.<InvokeAsync>d__1.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at Microsoft.Dynamics.Nav.Service.OData.NavODataRequestCompressionMiddleware.InvokeAsync(HttpContext context)
   at Microsoft.Dynamics.Nav.Service.OData.NavODataRequestUrlMiddleware.<InvokeAsync>d__1.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at Microsoft.Dynamics.Nav.Service.OData.NavODataRequestUrlMiddleware.InvokeAsync(HttpContext context)
   at Microsoft.Dynamics.Nav.Service.OData.NavODataResponseCompressionMiddleware.<InvokeAsync>d__2.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at Microsoft.Dynamics.Nav.Service.OData.NavODataResponseCompressionMiddleware.InvokeAsync(HttpContext context)
   at Microsoft.Dynamics.Nav.Service.OData.NavODataTelemetryIOMiddleware.<InvokeAsync>d__1.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at Microsoft.Dynamics.Nav.Service.OData.NavODataTelemetryIOMiddleware.InvokeAsync(HttpContext context)
   at Microsoft.Dynamics.Nav.Service.OData.V4.NavODataPartnerTelemetryMiddleware.<InvokeAsync>d__1.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at Microsoft.Dynamics.Nav.Service.OData.V4.NavODataPartnerTelemetryMiddleware.InvokeAsync(HttpContext context)
   at Microsoft.Dynamics.Nav.Service.OData.NavODataRequestTracingMiddleware.<InvokeAsync>d__1.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at Microsoft.Dynamics.Nav.Service.OData.NavODataRequestTracingMiddleware.InvokeAsync(HttpContext context)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.<Invoke>d__6.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>d__6.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Hosting.Internal.HostingApplication.ProcessRequestAsync(Context context)
   at Microsoft.AspNetCore.Server.HttpSys.MessagePump.ApplicationWrapper`1.ProcessRequestAsync(Object context)
   at Microsoft.AspNetCore.Server.HttpSys.MessagePump.<ProcessRequestAsync>d__23.MoveNext()
   at System.Runtime.CompilerServices.AsyncVoidMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at Microsoft.AspNetCore.Server.HttpSys.MessagePump.ProcessRequestAsync(Object requestContextObj)
   at System.Threading.Tasks.Task.Execute()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
   at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
 
ProcessId: 15104
Tag: 000023H
ThreadId: 81
CounterInformation:
CustomParameters: {
}
 

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

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,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans