Replies: 5 comments
-
Try disabling one filter at a time and see if one is causing a problem. How are you calling the Web API OData service? From JavaScript? |
Beta Was this translation helpful? Give feedback.
-
Thanks for the reaction. I'm calling the service (for testing purposes) directly from the web browser and/or Fiddler with the same result. I may try to play so more with the filters, but I've already spent a few hours on this issue and have to do more productive tasks :( |
Beta Was this translation helpful? Give feedback.
-
CSP may be blocking your call, you probably just need to add the connect-src 'self' directive. Did you get any browser errors? Security is hard, it makes a developers life difficult, it stops your app from doing what you want it to do but it is worth it in the long run. Once you've understood CSP, it gets a lot easier. |
Beta Was this translation helpful? Give feedback.
-
@Tesil Was it CSP causing the problem? Did you fix your error? Can I close this issue? |
Beta Was this translation helpful? Give feedback.
-
Well, I spent one work day solving this issue and it's not trivial to give the final and corect answer. First, there seems to be some complex set of issues in combinig MVC and WebApi in one project. It also looks like there is some kind of interference with Glimpse, that corrupts WebApi routing. Finally I've somehow made it work (but without IoC in WebApi ...). The whole thing is much more messy than I initially thought. Anyway, feel free to close this issue and thank you for your cooperation. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Using Odata in my Boilerplate project falls down to the Resource not found page (404). Further tracing using elmah shows, that there seems to be some problem with routing. Although the odata configuration and controllers are copied from different (not boilerplate) project (just changed namespaces), where everything works just fine. WebApiConfig si bound and model is created, which can be seen in debugger. Is there some default security(?) setting that prevents odata path to succesfuly create a controller?
I'm attaching the stack trace from Elmah for the odata request http://localhost:port/odata :
System.Web.HttpException (0x80004005): The controller for path '/odata/' was not found or does not implement IController.
v System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType)
v System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName)
v Castle.Proxies.Invocations.IControllerFactory_CreateController.InvokeMethodOnTarget()
v Castle.DynamicProxy.AbstractInvocation.Proceed()
v Glimpse.Core.Extensibility.CastleInvocationToAlternateMethodContextAdapter.Proceed()
v Glimpse.Core.Extensions.AlternateMethodContextExtensions.TryProceedWithTimer(IAlternateMethodContext context, TimerResult& timerResult)
v Glimpse.Core.Extensibility.AlternateMethod.NewImplementation(IAlternateMethodContext context)
v Glimpse.Core.Extensibility.AlternateTypeToCastleInterceptorAdapter.Intercept(IInvocation invocation)
v Castle.DynamicProxy.AbstractInvocation.Proceed()
v Castle.Proxies.IControllerFactoryProxy.CreateController(RequestContext requestContext, String controllerName)
v System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory)
v System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state)
v System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state)
v System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)
v System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
v System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Beta Was this translation helpful? Give feedback.
All reactions