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.

IInstanceContextProvider::GetExistingInstanceContext Method (Message^, IContextChannel^)

 

Called when a new message is received.

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

InstanceContext^ GetExistingInstanceContext(
	Message^ message,
	IContextChannel^ channel
)

Parameters

message
Type: System.ServiceModel.Channels::Message^

The incoming message.

channel
Type: System.ServiceModel::IContextChannel^

The channel that received the message.

Return Value

Type: System.ServiceModel::InstanceContext^

The System.ServiceModel::InstanceContext object that is used to process the message; return null to instruct WCF to create a new InstanceContext object.

The GetExistingInstanceContext method is called when a message is received. Return the InstanceContext object that you want to process the message, or null. In the case of null, WCF creates a new InstanceContext object for the message and then calls the InitializeInstanceContext method.

If you return null, the new InstanceContext object goes through the throttling system and increments the count of ServiceThrottle::MaxConcurrentInstances.

.NET Framework
Available since 3.0
Return to top
Show:
© 2017 Microsoft