HttpContext in WCF

后端 未结 3 628
心在旅途
心在旅途 2021-01-05 17:14

To use httpContext I changed app.config and added inside

相关标签:
3条回答
  • 2021-01-05 17:50

    Why don't you use OperationContext? http://msdn.microsoft.com/en-us/library/system.servicemodel.operationcontext.aspx

    0 讨论(0)
  • 2021-01-05 18:07

    It is possible to access HttpContext in WCF if you set AspNetCompatibility in web.config and on the Service Implementation.

    See here.

    0 讨论(0)
  • 2021-01-05 18:08

    See here: 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.

    0 讨论(0)
提交回复
热议问题