+3  A: 

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
+1 and thanks a lot Darin. can you give me a hint on how to mock it?
Oren A
@Oren, this will depend on the mocking framework you are using.
Darin Dimitrov