Assembly: System.ServiceModel (in system.servicemodel.dll)
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:
Prompt the user and obtain an appropriate System.Net.NetworkCredential.
Add a custom channel parameter object to the collection returned by the IChannel.GetProperty 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.
To insert IInteractiveChannelInitializer:
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.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 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:
Call either ClientBase.DisplayInitializationUI or IClientChannel.DisplayInitializationUI (or an asynchronous version).
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 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter EditionThe Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.