/// <summary> /// Constructs a <see cref="WSTrustChannel" />. /// </summary> /// <param name="requestChannel">The <see cref="IRequestChannel" /> this channel will be used to send a <see cref="WsTrustRequest" /> to the STS.</param> public WSTrustChannel(IRequestChannel requestChannel) { RequestChannel = requestChannel ?? throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(requestChannel)); if (requestChannel.State != CommunicationState.Created) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(LogHelper.FormatInvariant(SR.GetResourceString(SR.IRequestChannelMustBeCreated), requestChannel.State))); } MessageVersion = RequestChannel.GetProperty <MessageVersion>(); if (MessageVersion == null || MessageVersion == MessageVersion.None) { MessageVersion = MessageVersion.Default; } EndpointAddress endpointAddress = RequestChannel.GetProperty <EndpointAddress>(); if (endpointAddress != null) { Address = endpointAddress.Uri?.AbsoluteUri; } }
/// <summary> /// /// </summary> /// <param name="wsTrustChannelClientCredentials"></param> public WSTrustChannelSecurityTokenManager(WSTrustChannelClientCredentials wsTrustChannelClientCredentials) : base(wsTrustChannelClientCredentials) { _wsTrustChannelClientCredentials = wsTrustChannelClientCredentials ?? throw LogHelper.LogArgumentNullException(nameof(wsTrustChannelClientCredentials)); }