Ultimately, i'm trying to obtain a reference to the webmethod that will handle a request, BEFORE it handles the request, in order to check its custom attributes.
Currently, I have it working by appending the request path to the project namespace, removing the .asmx extension and replacing slashes with dots. However, this assumes that the class namespace hierarchy matches the request path hierarchy, and there's no reason why it should.
Short of opening the file and parsing it - is there a way that given a request path to an asmx file I can retrieve a reference to either the class type within or the name of the class type within?
Pretty new to .NET so what i'm doing might be silly. But either way, i'd be interested in the answer :)
EDIT: It's not my project, and it's locked in to using ASP.NET 3.5 and asmx webservices
EDIT: The aim is to be able to prevent certain webservices from being executed by unauthenticated users, without adding authentication code to every webmethod. My idea was to use a custom attribute on webmethods marking them as public, and only those will be allowed by a custom HTTP module or handler to be executed by an unauthenticated user. The type of user is stored in the session.