tags:

views:

46

answers:

1

Hi,

I'd like to gain control over the construction of a WebService instance in ASP.NET.

This is what I did so far: I created a .ASMX file and pointed it to a Class with WebServiceBinding and WebMethod attributes attached to it as usual. At the time I browse to the .ASMX file ASP.NET will automatically create an instance of the Class for me.

Is it somehow possible to hijack into the object factory of ASP.NET and do the instance creation by my self?

+1  A: 

You could write a custom handler (.ashx) and do it manually that way.

http://msdn.microsoft.com/en-us/library/ms227675(VS.85).aspx

Greg B
Can you be a bit more clear on how this would work? I do not want to rewrite the whole ASP.NET WebService architecture just to solve this problem.
Martin