コード例 #1
0
        public override IChannelFactory <TChannel> BuildChannelFactory <TChannel>(BindingContext context)
        {
            WSTrustChannelClientCredentials trustCredentials = Find <WSTrustChannelClientCredentials>(context.BindingParameters);

            if (trustCredentials == null)
            {
                var clientCredentials = Find <ClientCredentials>(context.BindingParameters);
                if (clientCredentials != null)
                {
                    trustCredentials = new WSTrustChannelClientCredentials(clientCredentials);
                    context.BindingParameters.Remove(typeof(ClientCredentials));
                    context.BindingParameters.Add(trustCredentials);
                }
                else
                {
                    trustCredentials = new WSTrustChannelClientCredentials();
                    context.BindingParameters.Add(trustCredentials);
                }
            }

            var channelFactory = base.BuildChannelFactory <TChannel>(context);

            return(channelFactory);
        }
コード例 #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="wsTrustChannelClientCredentials"></param>
 public WSTrustChannelSecurityTokenManager(WSTrustChannelClientCredentials wsTrustChannelClientCredentials)
     : base(wsTrustChannelClientCredentials)
 {
     _wsTrustChannelClientCredentials = wsTrustChannelClientCredentials ?? throw LogHelper.LogArgumentNullException(nameof(wsTrustChannelClientCredentials));
 }
コード例 #3
0
 /// <summary>
 /// Copy constructor
 /// </summary>
 /// <param name="other">The WSTrustChannelClientCredentials to create a copy of</param>
 protected WSTrustChannelClientCredentials(WSTrustChannelClientCredentials other)
     : base(other)
 {
     ClientCredentials    = other.ClientCredentials;
     SecurityTokenManager = other.SecurityTokenManager;
 }
コード例 #4
0
 /// <summary>
 /// Instantiates a <see cref="WSTrustChannelSecurityTokenManager"/>.
 /// </summary>
 /// <param name="wsTrustChannelClientCredentials"> the WSTrustChannelClientCredentials that can serve up a SecurityTokenProvider to use.</param>
 public WSTrustChannelSecurityTokenManager(WSTrustChannelClientCredentials wsTrustChannelClientCredentials)
     : base(wsTrustChannelClientCredentials)
 {
     _wsTrustChannelClientCredentials = wsTrustChannelClientCredentials ?? throw DiagnosticUtility.ExceptionUtility.ThrowHelper(new ArgumentNullException(nameof(wsTrustChannelClientCredentials)), System.Diagnostics.Tracing.EventLevel.Error);
 }