Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesDNN webservice and HTTPmessagehandlersDNN webservice and HTTPmessagehandlers
Previous
 
Next
New Post
7/30/2014 8:48 AM
 

Hey Community,

 I developed a module for DNN 7.x  which writes with help of a dnn webservice (stored in folder dnnroot\bin) data into a database. This module works - so far - fine.

Now I like to trace/log every request which arrives the webservice with help of HTTP Message Handlers. I tried a lot of different opportunities to add a new handler, but without success. Because i am not sure how to do it. The tutorial explains to extend the method register, but this method doesnt exist. I think i can use RegiserRoutes as well?!

 At the moment my idea is the following code in the RouterMapper.cs // The class LoggingHandler() is existing.

using System;
using System.Web.Http;
using DotNetNuke.Web.Api;

namespace Lifbi.Services.Password {
  public class RouteMapper : IServiceRouteMapper {

    public void RegisterRoutes(IMapRoute mapRouteManager) {

        GlobalConfiguration.Configuration.MessageHandlers.Add(new LoggingHandler());
        mapRouteManager.MapHttpRoute("modulename", "default", "{controller}/{action}", new[] { "namespace" });
    }
  }

}

The problem is: the name "GlobalConfiguration" is in the acutal context not available.

Maybe someone can help me, please. Thanks.

 
New Post
8/4/2014 5:10 AM
 
Nobody an idea how to work with this topic in DNN?

Anyway, I found a way to add an additional handler:

HttpConfiguration config = new System.Web.Http.HttpConfiguration();
config.MessageHandlers.Add(new LoggingHandler());

But it seems that the created handler is not in the handler pipeline. Is DNN using an own pipeline or configuration? Where can i find it?

I know that DNN extends a lot of implemented .NET features and because of this reason a solution for my problem must be possible?!

Thank you very much.
 
New Post
8/4/2014 7:56 PM
 
sorry, don't have time right now to create demo code, but couple of quick notes- yes, we do have our own implementation which wraps the WebAPI version and makes it aware of various DNN extensions (such as portals, portalaliaes etc.),If you take a look at the source (or online at https://github.com/dnnsoftware/Dnn.Pl... ) you can see the code - in particular look at https://github.com/dnnsoftware/Dnn.Pl... where you can see us setting us some GlobalConfiguration

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesDNN webservice and HTTPmessagehandlersDNN webservice and HTTPmessagehandlers


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out