Click to Rate and Give Feedback
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
IInteractiveChannelInitializer Interface

Updated: November 2007

Defines the methods that enable a client application to display a user interface to collect identity information prior to creating the channel.

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

Visual Basic (Declaration)
Public Interface IInteractiveChannelInitializer
Visual Basic (Usage)
Dim instance As IInteractiveChannelInitializer
C#
public interface IInteractiveChannelInitializer
Visual C++
public interface class IInteractiveChannelInitializer
J#
public interface IInteractiveChannelInitializer
JScript
public interface IInteractiveChannelInitializer

Implement the IInteractiveChannelInitializer interface to enable a client application to display a user interface that enables the user of the application to create or select the credentials prior to opening a channel.

To implement IInteractiveChannelInitializer, perform the following steps in IInteractiveChannelInitializer..::.BeginDisplayInitializationUI:

  1. Prompt the user and obtain an appropriate System.Net..::.NetworkCredential.

  2. Add a custom channel parameter object to the collection returned by the IChannel..::.GetProperty<(Of <(T>)>) method on the IClientChannel object with a type parameter of System.ServiceModel.Channels..::.ChannelParameterCollection. This channel parameter object is used by the custom System.ServiceModel..::.ClientCredentialsSecurityTokenManager to establish the security tokens for the channel.

  3. Return.

To insert IInteractiveChannelInitializer:

  1. Override the IEndpointBehavior..::.ApplyClientBehavior method on the System.ServiceModel.Description..::.ClientCredentials class.

  2. In that method, determine whether the endpoint requires an IInteractiveChannelInitializer and if so, add the IInteractiveChannelInitializer to the ClientRuntime..::.InteractiveChannelInitializers collection.

There are two ways application developers can make use of an inserted IInteractiveChannelInitializer. The client application can call either ClientBase<(Of <(TChannel>)>)..::.DisplayInitializationUI or IClientChannel..::.DisplayInitializationUI (or an asynchronous version) prior to opening the channel (the explicit approach) or simply call the first operation (the implicit approach).

If using the implicit approach, the application must call the first operation on an ClientBase<(Of <(TChannel>)>) or IClientChannel extension. If it calls anything other than the first operation, an exception is thrown.

If using the explicit approach, the application must perform the following steps in order:

  1. Call either ClientBase<(Of <(TChannel>)>)..::.DisplayInitializationUI or IClientChannel..::.DisplayInitializationUI (or an asynchronous version).

  2. When the initializers have returned, call either the Open method on the IClientChannel object or on the IClientChannel object returned from the ClientBase<(Of <(TChannel>)>)..::.InnerChannel property.

  3. Call operations.

It is recommended that production-quality applications control of the user-interface process by adopting the explicit approach.

Applications that use the implicit approach invoke the user-interface initializers, but if the user of the application fails to respond within the send timeout period of the binding, an exception is thrown when the user interface returns.

Windows Vista, Windows XP SP2, 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, 3.0
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker