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.Reflection 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