Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Is there easy way to detect WCF from HttpModule #84

Open
SergeyKanzhelev opened this issue Dec 14, 2016 · 2 comments
Open

Is there easy way to detect WCF from HttpModule #84

SergeyKanzhelev opened this issue Dec 14, 2016 · 2 comments

Comments

@SergeyKanzhelev
Copy link
Contributor

@tomasr - is there an easy way to detect that the request was processed by WCF infra from HttpModule? I am looking for a way to notify WCF users that they need to install WCF NuGet for better information collection from the standard ApplicationInsights.Web NuGet.

I'm thinking maybe some routing information got stored in HttpContext or something like this.

@tomasr
Copy link
Contributor

tomasr commented Dec 14, 2016

Not sure, but maybe checking HttpContext.Handler against known handlers? For integrated pipeline mode, this should be System.ServiceModel.Activation.HttpHandler, System.ServiceModel.Activation.ServiceHttpHandlerFactory, or System.ServiceModel.Activation.AspNetRouteServiceHttpHandler.

Not entirely sure this would be possible at the stage your're hooking into, but might be a possibility.

@tomasr
Copy link
Contributor

tomasr commented Dec 18, 2016

I did some more checking on this, and it would appear that if you wanted to use HttpContext.Current, you'd need to also hook into the PostMapRequestHandler event (which can fire multiple times for each request), as looking at this either in BeginRequest or EndRequest would just return null.

Not sure if this is something you'd be able to do.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants