Project Description
Web API Explorer for DNN(R) aids module development allowing you to examine the Routing Table entries for a DotNetNuke(R) portal.

Services Framework WebAPI in DotNetNuke 7

One of the exciting new capabilities in DotNetNuke 7.x is the integration of ASP.NET Routing (Web API) as a means of exchanging JSON data between your custom extension and your DotNetNuke portal.

As this is a relatively new feature of DNN, it seems fitting to have a tool to better understand what routes exist in your portal at any given time. This tool is a simple DNN module that displays the registered routes in a portal so developers can see how to interact with them on the client.

Routing of HTTP requests is not new to those in the MVC arena, but for those who are more used to developing with Web Forms, it can seem quite mysterious. At first blush, many might think Web API is only usable in MVC or SPA (Single Page Application) projects, but the truth is that Web API can be used in any kind of ASP.NET application (from SharePoint to DotNetNuke to MVC and SPA and beyond). Shaun Walker has written a good blog to describe how it fits in to ASP.NET and DotNetNuke in particular ("Microsoft Declares the Future of ASP.NET is Web API").

A great area to begin learning about Web API and Routing is to visit the MSDN articles on the topic.

Major Features

Designed for developers working with the Services Framework WebAPI in DotNetNuke 7, this module has the following features.
  • Lists all registered entries in the RouteTable, displaying
    • Route Name
    • URL Pattern
    • Controller Classes, including
      • Methods returning an HttpResponseMessage
      • Method attributes (to distinguish HttpGet, HttpPost, DnnAuthorize, ValidateAntiForgeryToken, etc.)
      • Sample JavaScript to setup and call $.ajax() for the specific WebAPI.
  • Restricted to being viewed by Authenticated Users only (making it safer to display on a live site)

Roadmap

The following features (in no specific order) are slated for development in upcoming releases of this module.
  • Method parameter info
  • Better sample JavaScript
    • Group all methods from controller into one constructor
    • Checkboxes to allow user to pick & choose methods to include in script
  • Better UI
    • Buttons to make navigating easier/more intuitive
  • Working links to some demo AJAX services (for illustrating common combinations of method attributes)
    • Links to show server-side code C# for demo services
    • Restricted to Administrator/SuperUser access only
    • (Distant Future) Ability to test your own WebAPI routes
      • Restrict access to routes in the DNN framework
      • "Watch List" of which WebAPI routes to examine/watch
      • "Proxy" invocation, where all calls are passed to a proxy route that invokes the Controller method and returns the method result, but wraps everything in an enterprise-level transaction to ensure a rollback
  • Flags for conflicts and/or ambiguous route url patterns
    • Check that the order of the route in the routing table is properly displayed (as it affects potential conflicts)
  • Syntax highlighting for sample JavaScript
  • Button to copy JavaScript code to the clipboard
  • Properly handle and display any non-standard routing information (where the Routing Table entry is not inheriting from the Route class)
  • Help information on all the method attributes (HttpGet, DnnAuthorize, etc.)

Last edited Jun 27, 2013 at 3:35 PM by dagilleland, version 7