473,581 Members | 2,785 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Resolving from httpContext to Class name

Hi,

I feel like i'm being a little dense:

I have created an HttpModule to do some security checking for a
webservice. The HttpModule hijacks any request to the webservice, and
gets passed a reference to the HttpContext for each call. The
HttpContext contains all sorts of lovely information, like the URL of
call request, the inside leg measurement of the caller... etc. So far
so good.

My HttpModule has access to the Assembly object containing the
webservices. I have cunningly added security info to each webservice
using some custom attributes, the details of which I will not bore you
with. All I have to do is work out from the HttpContext, which
webservice, and which webmethod I've called, read the custom
attribute, and Voila - my job is complete.

But, oh no, it is not that simple: The HttpContext only seems to
supply URL information, so I can find out the name of the .asmx file
CONTAING my class - but not the class name... and using
System.Reflecti on to drill down though my Application, only gives me
Types - which have Class names, nowhere does Application seem to give
the names of the containing .asmx files.

So I'm forced to physically read the .asmx files manually based on the
incoming URL, and parse the contents looking for the Class name... but
this does seem a bit crappy... IS THERE ANOTHER WAY???

Thanks
Steve
in to the service , which gets passed through
Jul 21 '05 #1
0 1337

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
259
by: Stephen M | last post by:
Hi, I feel like i'm being a little dense: I have created an HttpModule to do some security checking for a webservice. The HttpModule hijacks any request to the webservice, and gets passed a reference to the HttpContext for each call. The HttpContext contains all sorts of lovely information, like the URL of call request, the inside leg...
0
1282
by: John | last post by:
I'm trying to create a context object similar to the HttpContext that could be used by business objects independent of the origin or the call (ASP.NET or standalone). So I started out by using ThreadStatic variables to maintain state for the current request but soon found out that this doesn't work in ASP.NET since one request can run...
1
6491
by: josephpage | last post by:
I have a Visitor class that is defined in a class library. The class has lots of parameters that are pulled from the QueryString, the ReferrerUrl, Cookies, the Session object, etc... I would like to make a constructor for the Visitor class that accepts an HttpContext instance from within Session_Start in Global.asax.cs as an input...
3
1936
by: Steve Lutz | last post by:
Hello All, I have an ASPX page whose class inherits from a company global base page. The company base page has a property call PageTitle (string) that is assigned by all the pages. The base class also includes a class that is used for logging. This logging class uses HttpContext.Current.Handler to get the instance of the page. In this...
3
2964
by: Steve Franks | last post by:
Is there a way I can extend the HttpContext or one of its subclasses to include a property that exposes a custom class of mine to all ASP.NET pages? More specifically, I'd like to use a HttpModule to initialize an instance of a custom class, and have this class exposed directly through the HttpRequest for the current user through a property...
2
2132
by: | last post by:
Today I learned that creating cookies inside of a custom class in ASP.NET 2.0 requires that you prefix it with HttpContext.Current..., e.g. : HttpContext.Current.Response.Cookies.Add("myNewCookie"); I am wondering if there are any landmines that I should know about, or if this will work pretty much as I am expecting a cookie should.
0
2180
by: Rodusa | last post by:
I am trying to replace cookies with the new "Asp.net 2.0 profiles" in my shopping cart application, but I am having trouble to access profile properties using HttpContext.Current.Profile. I can access any other property property of this class from a regular aspx page, but not from inside the class itself. This is the piece of the code that...
0
5361
by: Aaron Morton | last post by:
I'm working on a IHttpModule that handles the PreSendRequestHeaders event from the HttpApplication, if the event is raised after EndRequest then HttpContext.Current is null. If it is raised before EndRequest (by turning response buffering off) then HttpContext.Current is set. To repo add the following to Global.asax protected void...
4
27985
by: Sami Rehman | last post by:
hi i have a vs solution in which there are 2 projects class library representing Security services and another one is web application project. i need to access http context in a static method in a class of Security Services project. how can this be done. thanks -sami
0
7804
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8156
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8180
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6563
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5681
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5366
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3809
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3832
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1409
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.