WebOperationContext.Current Property

 

Gets the current Web operation context.

Namespace:   System.ServiceModel.Web
Assembly:  System.ServiceModel.Web (in System.ServiceModel.Web.dll)

public static WebOperationContext Current { get; }

The following code shows how to access the current WebOperationContext instance.

WebOperationContext current = WebOperationContext.Current;
WebHeaderCollection headers = current.IncomingRequest.Headers;

foreach (string name in headers)
{
    Console.WriteLine(name + " " + headers.Get(name));
}

.NET Framework
Available since 3.5
Silverlight
Available since 4.0
Return to top
Show: