title: OData no http resource was found that matches the request uri
body: <p>I'm having some trouble getting my Odata service working with my MVC 4 site.</p>
  
  <p>Can you help me figure out what I'm doing wrong?</p>
  
  <p>Here is my WebApiConfig:</p>
  
  <pre><code>  public static class WebApiConfig
  {
      /// &lt;summary&gt;
      /// The Register method
      /// &lt;/summary&gt;
      /// &lt;param name="config"&gt;The config.&lt;/param&gt;
      public static void Register(HttpConfiguration config)
      {
          config.MapODataServiceRoute("odata", "odata", GetEdmModel(), new DefaultODataBatchHandler(GlobalConfiguration.DefaultServer));
          config.EnsureInitialized();
      }
      private static IEdmModel GetEdmModel()
      {
          ODataConventionModelBuilder builder = new ODataConventionModelBuilder();
          builder.Namespace = "ThisClassesNamespace";
          builder.ContainerName = "DefaultContainer";
          builder.EntitySet&lt;QueryRequest&gt;("QueryRequests");
          var edmModel = builder.GetEdmModel();
          return edmModel;
      }
  }
  </code></pre>
  
  <p>here is the global.asax's application_start method:</p>
  
  <pre><code>  protected void Application_Start()
      {
          Application["Name"] = "Administration Web Console";
          GlobalConfiguration.Configure(WebApiConfig.Register);
          AreaRegistration.RegisterAllAreas();
  
          RegisterRoutes(RouteTable.Routes);
  
          Error += MvcApplication_Error;
  
          var maplayerDao = new MapLayerDao();
          maplayerDao.UpdateProvisioningData();
  
          var factory = new CustomControllerFactory();
          ControllerBuilder.Current.SetControllerFactory(factory);
  
      }
  </code></pre>
  
  <p>finally, here is what the controler's get method looks like</p>
  
  <pre><code> public class QueryRequestsController : ODataController
  {
      private static ODataValidationSettings _validationSettings = new ODataValidationSettings();
      private QueryRequestDao dao = new QueryRequestDao();
  
      // GET: odata/QueryRequests
      [HttpGet]
      public IHttpActionResult GetQueryRequests()
      {
          // validate the query.
          try
          {
             // queryOptions.Validate(_validationSettings);
          }
          catch (ODataException ex)
          {
              return BadRequest(ex.Message);
          }
  
           return Ok&lt;IEnumerable&lt;QueryRequest&gt;&gt;(dao.GetQueryRequests());
      }
  </code></pre>
  
  <p>I can get the metadata just fine at <a href="http://10.78.14.177:8040/odata/" rel="nofollow">http://10.78.14.177:8040/odata/</a></p>
  
  <p>which gives me:</p>
  
  <pre><code>{
   "@odata.context":"http://10.78.14.177:8040/odata/$metadata","value":[
  {
    "name":"QueryRequests","kind":"EntitySet","url":"QueryRequests"
  }
  </code></pre>
  
  <p>]
  }</p>
  
  <p>but when I go to <a href="http://10.78.14.177:8040/odata/QueryRequests" rel="nofollow">http://10.78.14.177:8040/odata/QueryRequests</a>
  I get No HTTP resource was found that matches the request URI '<a href="http://10.78.14.177:8040/odata/QueryRequests" rel="nofollow">http://10.78.14.177:8040/odata/QueryRequests</a>'.</p>
  
  <p>I think the MVC routing is getting this request and it is not going to the OData service... but I'm not sure what the fix is.</p>
  
  <p>Any ideas?</p>