httpmodule

Detecting type of webservice in httpmodule

Hi, Is there any way to detect the type of a webservice inside a httpmodule? The reason for this is that I want to do some property injection to the webservice before it's processed. I found this: http://social.msdn.microsoft.com/Forums/en/asmxandxml/thread/0e848eee-d353-4e67-b47f-89fddb600009 but that is one h..l of an ugly solution....

httpModules not working on iis7

Hi, I have the following module public class LowerCaseRequest : IHttpModule { public void Init(HttpApplication context) { context.BeginRequest += new EventHandler(this.OnBeginRequest); } public void Dispose() { } public void OnBeginRequest(Object s, EventArgs e) { Ht...

HTTP MODULE Event Does Not Fire When Click Browser's Back Button

I Wrote an Http Module that checks if logged user is restricted disables images on the page. void application_AuthorizeRequest(object sender, EventArgs e) { . . . if (context.User.IsInRole("Restricted") && Path.GetExtension(context.Server.MapPath(context.Request.FilePath)).ToLower() == ".jpg") { context.Response.S...

Installing HTTPModule into GAC

While playing around with Sharepoint and WCF, I came across an article - Sharepoint 2007 and WCF in which the author stated the need to fix the Virtual Path Provider. He accomplished this with an HTTPModule. However, since this is a global fix, I am wondering what is the best way to install the new module into GAC? Is this the same proce...

How do I attach Visual Studio 2010 to IIS 7 to debug a custom HttpModule written for an existing 3rd party web application.

First a little background on what I am trying to achieve. I have a client application that is utilizing REST services served by ArcGIS Server and IIS 7. I want to be able to modify the response (remove or add parameters) before the response is sent to the client. Therefore, I am developing a custom HttpModule using Visual Studio 2010 a...

Is it possible to modify the content of HttpRequest POST in an IIS HttpModule?

Hi, I need to modify the content of certain HttpRequests (SSAS connection strings) in IIS. Basically, I need to add an element to the SOAP contained in the request. My approach so far has been to add a Filter to the HttpRequest, and perform the change in the filter's Read method. As far as I can tell, though, Read is never being execut...

Looking for example code to create an IronPython HTTPModule

Can someone point me to some skeleton code for creating and wiring up a HTTPModule built in ironPython? ...

IHttpModule Init not fired

Hi, I have got problem with contextInfo [WebMethod] [SoapHeader("UserInfo", Direction = SoapHeaderDirection.In)] public void TestContext() { var user = ContextInfo.Current.User.LoginName; } UserInfo _userInfo; [System.Xml.Serialization.SoapElement(IsNullable = true)] public UserInfo UserInf...

How to protect application pools from session serialization exceptions?

We're using an Out-of-Process Session Provider (ScaleOut) for an ASP.NET application and we've noticed that when an object that's not correctly setup for de-serialization inadvertently makes its way into session it will eventually cause the entire process to terminate. Reproducing and handling this scenario is where it gets even more i...

How to handle application start event in ASP.NET module

I am writing an asp.net HTTP module which needs to read configuration data once from a local file (say config.xml stored in application root directory) and then based on configuration perform some processing on incoming requests. Since there is no Application_Start/Application_init hooking available in Asp.NET modules, what would be th...

ASP.NET WebForms -- Processing special query-string parameters across all pages on a site -- URL Rewriting, URL Routing, or other approaches?

Working on an ecommerce site which will be integrated with a 3rd party vendor--that vendor uses different identifiers for stores than we use internally (i.e. their store ABC123 is our 001-321). I'm researching the best approach to inspect incoming requests for reserved query-string parameters that indicate the request is using their ide...

impersonation in asp.net not working with sql server

I have a very strange problem. I have a httpmodule that is running with impersonation (for an anonymous user) through IIS. Impersonation is not taking effect in some cases but is in others. The module is doing an asynchronous web service call, followed by a database call. All of this takes place in the PreRequestHandler event. I'm findin...

asp.net httpmodule loses its identity on callback

My HttpModules uses the PreRequestHandlerExecute event and seems to be losing the identity which I am impersonating when I get to the callback function. I can check the user it is running under (with Environment.UserName) and it goes from the impersonated user (in the begin function) to Network Service(in the end function). Anyone seen ...

HTTPModule filter questions

I have one issues I'm struggling with with regards to my HTTPModule filter: 1) I notice that the module gets it's data in chunks. This is problematic for me because I'm using a regex to find and replace. If I get a partial match in one chunk and the rest of the match in the second, it will not work. Is there any way to get the entire re...

ASP.NET custom HTTPModule - how to tell when writing last block of HTML in Write method?

I have written an Http Module that hooks onto the Response.Filter property of the current request and does various replacements within the HTML before it is sent to the client. All the work is done in the Write method which is overriding Write in the base class Stream. The Write method is called multiple times for a single response - t...

ASP.NET HttpModule for page controls loading

Hi. I have some problem to be solved. There're directories in web service which will construct my webpage's menu and controls. Example of paths: \\*Country\\*Division\\*Part\\*Item\\*Control *some_root_path\USA\LADivision\ReportsPart\EditReportItem\LoadItemsControl *some_root_path\USA\LADivision\ReportsPart\EditReportItem\ClearItem...

Unique way to identify page instance within HttpContext

You can get the name of a page within HttpContext via Request.Path. Is there a way to distinguish between different requests from the same page? That is when two different instances of yourpage.aspx make a request, how can you distinguish between the two using HttpContext? ...

How can I modify a POST request using a custom IHttpModule and an HttpRequest filter?

Overview I want to be able to modify request parameters and content to 3rd party web services (ArcGIS Server). This will be used to create a security layer that exists between any client application and the server application. I think that I have found a solution but I am current having some difficulties in the implementation. Pote...

Ihttpmodule ,Ihttphandler .NET

I have some doubt over HttpModule and HttpHandler Please help me to clarify 1)In HttpModule I have noticed methods Init called only once . context_BeginRequest and context_EndRequest etc method calling for each request. Is it guaranteed that for a module Init will call once for different users(or different request) and BeginRequest etc...

Optimization for OnAuthentication method using HttpModule.

I made an OnAuthentication method in MVC app. public class MyApplication: HttpApplication { private static IWindsorContainer container; protected void Application_Start() { container = new WindsorContainer(); Container.Register( Component.For<IUserRepository>().ImplementedBy<UserRepository>() ...