How to use unity in web service

Jan 28, 2009 at 10:07 PM
I have a web service like this

    public class WebLoggingService : WebService
        ILog logger;

        public ILog Logger
            set { logger = value; }

        public void Log(string message)

Is there a place(using http module) in the http request pipeline to do the injection of ILog using Unity?



Jan 30, 2009 at 7:48 AM

Please see this thread:

also this link:

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
Jan 30, 2009 at 4:08 PM
Edited Jan 30, 2009 at 4:25 PM
Thank you for your reply.

But my question is how to inject into a WEB SERVICE in http module. For aspx page there are bunch of solutions out there.

And also the web service isn't supposed to be wrapped in a WCF service.


Jan 30, 2009 at 6:12 PM
Michael Puleio (a fellow p&p dev) and I went looking for exactly this hook a couple of months ago. Unfortunately, we didn't find one - as far as I know there's no way to hook the construction of ASMX web service objects.

We did come up with a workaround, though. Check out Mike's blog here to see what we ended up with. The web service stuff is at the end of the post.

Jan 30, 2009 at 6:22 PM
Thanks, got it.