OperationContext Constructor (IContextChannel^)
Initializes a new instance of the OperationContext class that uses the specified IContextChannel in a client application.
Assembly: System.ServiceModel (in System.ServiceModel.dll)
Parameters
- channel
-
Type:
System.ServiceModel::IContextChannel^
The IContextChannel used to create a new client OperationContext.
| Exception | Condition |
|---|---|
| ArgumentNullException | The channel is null. |
Use the OperationContext constructor to create a new operation context within the scope of which the proxy is associated in order to modify outbound items such as headers.
The following example shows how to use the OperationContextScope to create a new context in a client application in order to add a custom header to the outgoing message.
Available since 8
.NET Framework
Available since 3.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0