ASP.NET Web API OData batch returning HTTP 404

I’m getting started with ASP.NET Web API v2 and OData (v3).
I’ve got a client made with JayData v 1.3.6

Client Context

onlinedb = new $todo.Types.ToDoContext({
    name: 'oData',
    oDataServiceHost: 'http://localhost:49375/odata'
});

Server Routes

public static void Register(HttpConfiguration config)
{
    // Web API configuration and services
    ODataConventionModelBuilder builder = new ODataConventionModelBuilder();
    builder.ContainerName = "WebAPIDataCollectorContext";
    builder.EntitySet<TodoItem>("Todo");
    config.Routes.MapODataRoute("odata", "odata", builder.GetEdmModel(), new DefaultODataBatchHandler(GlobalConfiguration.DefaultServer));

    // Web API routes
    config.MapHttpAttributeRoutes();

    config.Routes.MapHttpRoute(
        name: "DefaultApi",
        routeTemplate: "api/{controller}/{id}",
        defaults: new { id = RouteParameter.Optional }
    );

    config.EnableCors();
}

Request
OPTIONS /odata/$batch HTTP/1.1 (From Fiddler)

Response

{"Message":"No HTTP resource was found that matches the request URI 'http://localhost:49375/odata/$batch'.","MessageDetail":"No route providing a controller name was found to match request URI 'http://localhost:49375/odata/$batch'"}

Comments

http://localhost:49375/odata/Todo (GET operation) is working fine.

The question is: Why is batch operation failing?

Thanks!

Web API 2: OData 4: Actions returning 404

I have an OData v4 action method which is not working; note however that it was working fine in OData v3 (I am obviously in the process of trying to update my project) OData Action Method: [HttpPost]

Web Api 2.2 and OData, handle 404

I am working on a OData project. Right now we are facing only one issue. If the Client send a request to a path (URL) that does not exist, the MVC stack return the default HTML page 404 which in OData

How to use a Database Generated Identity Key in Web Api OData

I’ve managed to create number of readonly Web Api OData services following the tutorials here: http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api. I’m therefore employing the ODataCon

ASP.NET WebApi Odata error 404

I am new to OData. Thus, I’m following this tutorial very closely. (http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/getting-started-with-odata-in-web-api/create-a-read-only-odata-e

How to get ASP.Net Web API and OData to bind a string value as a key?

I’m going through a short Web Api + OData tutorial from asp.net: http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/getting-started-with-odata-in-web-api/create-a-read-only-odata-endp

How to invoke a Asp.Net Web API 2.0 http batch request using Angular?

I created a sample web api in Asp.Net Web Api 2.0 with Http batch support. http://blogs.msdn.com/b/webdev/archive/2013/11/01/introducing-batch-support-in-web-api-and-web-api-odata.aspx describes the e

web api odata service – return complex type

i want to create web api odata service that return reault type which consist of collection data member and additional members like this service return: http://services.odata.org/OData/OData.svc/Suppli

Wcf Web APi OData

I have recently discovered OData & the new WCF Web APi library on codeplex. The web api allows me to expose results as IQueryable, which allows me to expose URL’s in the OData format. Myn question

customizing odata output from asp.net web api

I’m using the new ASP.NET webapi odata (version 4.0.0 last published 27/2/2013 according to Nuget) Basically I’m doing it as described here: http://www.asp.net/web-api/overview/odata-support-in-aspnet

Web API OData inlinecount not mapped

My question is similar to: web-api-odata-inlinecount-not-working I have installed the following packages: <packages> <package id=Microsoft.AspNet.Cors version=5.0.0-rc1 targetFramework=n

Answers

Batch operations aren’t supported by ASP.NET WebAPI OData, but you can configure it by following this article – Introducing batch support in Web API and Web API OData