Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

OperationContext Constructor (IContextChannel^)

 

Initializes a new instance of the OperationContext class that uses the specified IContextChannel in a client application.

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

public:
OperationContext(
	IContextChannel^ channel
)

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.

No code example is currently available or this language may not be supported.

Universal Windows Platform
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
Return to top
Show:
© 2017 Microsoft