HttpContext in WCF
To use httpContext, I changed app.config and added <serviceHostingEnvironment aspNetCompatibilityEnabled="true"> inside <system.serviceModel> .
I also added using System.Web to my implementation class.
The problem is that httpcontext is not available in my implementation class after completing the necessary steps.
What am I missing?
See here: WCF Services and ASP.NET
In the AppDomain application, the functions used when performing HTTP execution for ASP.NET content, but not for WCF. Many of the HTTP-specific features of the ASP.NET Application Platform cannot be applied to WCF services hosted inside the AppDomain containing ASP.NET content. Examples of these features include the following:
HttpContext: the current is always zero when accessing from WCF service provision. Use RequestContext instead.
Why aren't you using OperationContext? http://msdn.microsoft.com/en-us/library/system.servicemodel.operationcontext.aspx