Επεξεργασία

Κοινή χρήση μέσω


IInstanceContextProvider.GetExistingInstanceContext Method

Definition

Called when a new message is received.

public:
 System::ServiceModel::InstanceContext ^ GetExistingInstanceContext(System::ServiceModel::Channels::Message ^ message, System::ServiceModel::IContextChannel ^ channel);
public System.ServiceModel.InstanceContext GetExistingInstanceContext (System.ServiceModel.Channels.Message message, System.ServiceModel.IContextChannel channel);
abstract member GetExistingInstanceContext : System.ServiceModel.Channels.Message * System.ServiceModel.IContextChannel -> System.ServiceModel.InstanceContext
Public Function GetExistingInstanceContext (message As Message, channel As IContextChannel) As InstanceContext

Parameters

message
Message

The incoming message.

channel
IContextChannel

The channel that received the message.

Returns

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

Remarks

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.

Applies to