title: Webapi Controller - Routing not working
body: <p>i have problem with my webapi controller, can not make it work correctly....</p>
  
  <p>What is wrong?</p>
  
  <p>Here the code:</p>
  
  <pre><code>WeabiConfig.cs
  
          EnableCrossSiteRequests(config);
  
          config.MapHttpAttributeRoutes();
  
          config.Routes.MapHttpRoute(
              name: "Api",
              routeTemplate: "api/{controller}/{key}",
              defaults: new { key = RouteParameter.Optional }
          );
  
          // this i added
          config.Routes.MapHttpRoute(
              name: "Action",
              routeTemplate: "api/{controller}/{action}"
           );
  </code></pre>
  
  <p>MyController:</p>
  
  <pre><code>    [ActionName("TransformXMLToHTML")]
      [System.Web.Http.AcceptVerbs("GET")]
      [System.Web.Http.HttpGet]
      public IHttpActionResult TransformXMLToHTML()
      {
          string xsltString  = File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("~/Xml/inputXslt.xslt"));
          string inputXml = File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("~/Xml/inputXml.xml"));
          XslCompiledTransform transform = new XslCompiledTransform();
          using (XmlReader reader = XmlReader.Create(new StringReader(xsltString)))
          {
              transform.Load(reader);
          }
          StringWriter results = new StringWriter();
          using (XmlReader reader = XmlReader.Create(new StringReader(inputXml)))
          {
              transform.Transform(reader, null, results);
          }
          return Ok(results.ToString());
      }
  </code></pre>
  
  <p>GET Request: <a href="http://localhost:60674/api/comments/TransformXMLToHTML" rel="nofollow">http://localhost:60674/api/comments/TransformXMLToHTML</a></p>
  
  <p>Error: No action was found on the controller 'Comments' that matches the request</p>
  
  <p>Thanks guys!</p>