If this is an .asmx web service then you will have no problems using HttpContext.Current. The only problem is with your unit test. It's never going to work because HttpContext.Current is always null. You could use an abstraction : HttpContextBase which could be mocked in the unit test. If it is a WCF web service then it is a whole different matter.
Darin Dimitrov
2010-09-27 18:58:09