This documentation is archived and is not being maintained.

WebOperationContext.IncomingResponse Property

Gets the Web response context for the request being received.

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

public IncomingWebResponseContext IncomingResponse { get; }

The following code shows how to get the content length, content type, and status code from the IncomingResponse property.

WebOperationContext current = WebOperationContext.Current;
Console.WriteLine("Incoming Response");
Console.WriteLine("ContentLength: " + current.IncomingResponse.ContentLength);
Console.WriteLine("ContentType: " + current.IncomingResponse.ContentType);
Console.WriteLine("StatusCode: " + current.IncomingResponse.StatusCode);

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5