tags:

views:

286

answers:

1

i have a wcf rest service which is being polled by the client . i want to access iis server variables without enabling AspNetCompatibilityRequirements since that causes performance hits which my polling application cannot effort.

any suggestions?

+1  A: 

Use the WebOperationContext class (in System.ServiceModel.Web) - it gives you access to an equivalent of the HttpContext Request.

However, unless you enable Asp.Net hosting you can't necessarily get the same information because IIS in that case is used simply as an activation method for the service, rather than a host. Whereas with AspNetCompatibilityRequirements set to Required or Allowed the service is actually hosted inside Asp.Net within IIS.

Andras Zoltan