HttpContext.Current.User is null when IsOneWay = true

841 Views Asked by At

I have wcf services. Some of them are one way, some are not. Those that are not one way work with forms authentication and i get HttpContext.Current.User. Those that are one way get a null in HttpContext.Current.User.

How to fix?

I am using ASP.NET Compatibility Mode

1

There are 1 best solutions below

3
On

Via HttpContext.Current is null in my web service:

WCF Services and ASP.NET

Within an AppDomain, features implemented by the HTTP runtime apply to ASP.NET content but not to WCF. Many HTTP-specific features of the ASP.NET application platform do not apply to WCF Services hosted inside of an AppDomain that contains ASP.NET content. Examples of these features include the following:

HttpContext: Current is always null when accessed from within a WCF service. Use RequestContext instead.

[...]

HttpContext: WCF services running in ASP.NET Compatibility Mode can access Current and its associated state.