I am new to DNN. Not new to development. I hope this is an appropriate place to post a question about development to the community.
I am trying to setup a WebAPI using services framework. I have followed this blog and this blog. I have a visual studio class project setup to output a dll in my local development iis server bin directory (C:\inetpub\wwwroot\bin). The module compiles and puts the dll in the location I would expect. I am not getting a route to register and try as I may cannot determine why. Can anyone offer any insight?
RouteMapper.cs contains:
using System;
using DotNetNuke.Web.Api;
namespace MyServices
{
class RouteMapper : IServiceRouteMapper
{
public void RegisterRoutes(IMapRoute mapRouteManager)
{
mapRouteManager.MapHttpRoute("MyServices", "default", "{controller}/{action}", new[] { "MyServices" });
}
}
}
WelcomeController.cs contains
using System;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using DotNetNuke.Web.Api;
namespace MyServices
{
public class WelcomeController : DnnApiController
{
[AllowAnonymous]
[HttpGet]
public HttpResponseMessage HelloWorld()
{
return Request.CreateResponse(HttpStatusCode.OK, "Hello World!");
}
}
}
My log does not show the route gettting mapped
<br>2013-02-13 15:19:23,457 [D5TSBXQ1][Thread:7][TRACE] DotNetNuke.Common.Initialize - Request /Host/HostSettings/tabid/16/portalid/0/Default.aspx
<br>2013-02-13 15:19:23,463 [D5TSBXQ1][Thread:7][INFO] DotNetNuke.Common.Initialize - Application Initializing
<br>2013-02-13 15:19:23,926 [D5TSBXQ1][Thread:7][TRACE] DotNetNuke.Web.Api.Internal.ServicesRoutingManager - Mapping route: CoreMessaging-default-0 @ DesktopModules/CoreMessaging/API/{controller}/{action}
<br>2013-02-13 15:19:23,932 [D5TSBXQ1][Thread:7][TRACE] DotNetNuke.Web.Api.Internal.ServicesRoutingManager - Mapping route: SocialGroups-default-0 @ DesktopModules/SocialGroups/API/{controller}/{action}
<br>2013-02-13 15:19:23,938 [D5TSBXQ1][Thread:7][TRACE] DotNetNuke.Web.Api.Internal.ServicesRoutingManager - Mapping route: Journal-default-0 @ DesktopModules/Journal/API/{controller}/{action}
<br>2013-02-13 15:19:23,945 [D5TSBXQ1][Thread:7][TRACE] DotNetNuke.Web.Api.Internal.ServicesRoutingManager - Mapping route: MemberDirectory-default-0 @ DesktopModules/MemberDirectory/API/{controller}/{action}
<br>2013-02-13 15:19:24,002 [D5TSBXQ1][Thread:7][TRACE] DotNetNuke.Web.Api.Internal.ServicesRoutingManager - Mapping route: InternalServices-default-0 @ DesktopModules/InternalServices/API/{controller}/{action}
<br>2013-02-13 15:19:24,283 [D5TSBXQ1][Thread:7][TRACE] DotNetNuke.Web.Api.Internal.ServicesRoutingManager - Registered a total of 5 routes
DNN Info: