Пример #1
0
        void CheckNetworkDtcAccessStatus()
        {
            Utilities.Log("CheckNetworkDtcAccessStatus");

            bool networkTransactionEnabled;

            try
            {
                networkTransactionEnabled = msdtc.GetNetworkTransactionAccess();
            }
            catch (WsatAdminException e)
            {
                HandleException(e);
                networkTransactionEnabled = oldNetworkSupportEnabledValue;
            }

            if (!networkTransactionEnabled)
            {
                // If Msdtc network access is disabled, we'll disable the NetworkSupport checkbox anyway
                Utilities.Log("CheckNetworkDtcAccessStatus: msdtc.GetNetworkTransactionAccess = false");
                this.checkBoxEnableNetworkSupport.Checked = false;
                this.checkBoxEnableNetworkSupport.Enabled = false;
            }
            else
            {
                // Otherwise, we can't simply check it - we should use the original state saved before
                // navigating away from the tab
                Utilities.Log("CheckNetworkDtcAccessStatus: msdtc.GetNetworkTransactionAccess = true");
                this.checkBoxEnableNetworkSupport.Enabled = true;
                this.checkBoxEnableNetworkSupport.Checked = this.oldNetworkSupportEnabledValue;
            }
        }
Пример #2
0
        internal void ValidateThrow()
        {
            if (this.TransactionBridgeEnabled)
            {
                // rule: WS-AT network support requires MSDTC network transaction to be enabled

                // GetNetworkTransactionAccess fails if current remote cluster node does not take ownership
                if (!IsClusterRemoteNode)
                {
                    MsdtcWrapper wrapper = this.GetMsdtcWrapper();
                    if (!wrapper.GetNetworkTransactionAccess())
                    {
                        throw new WsatAdminException(WsatAdminErrorCode.MSDTC_NETWORK_ACCESS_DISABLED,
                                                     SR.GetString(SR.ErrorMsdtcNetworkAccessDisabled));
                    }
                }

                // rule: HTTPS port must be in range 1-65535
                if (this.HttpsPort < 1)
                {
                    throw new WsatAdminException(WsatAdminErrorCode.INVALID_HTTPS_PORT,
                                                 SR.GetString(SR.ErrorHttpsPortRange));
                }

                // rule: local endpoint certificate must be specified and valid
                ValidateIdentityCertificateThrow(this.X509Certificate, !Utilities.IsLocalMachineName(MachineName));

                // rule: default timeout should be in range 1-3600
                if (this.DefaultTimeout < 1 || this.DefaultTimeout > 3600)
                {
                    throw new WsatAdminException(WsatAdminErrorCode.INVALID_DEFTIMEOUT_ARGUMENT,
                                                 SR.GetString(SR.ErrorDefaultTimeoutRange));
                }

                // rule: max timeout be in range 0-3600
                if (this.MaxTimeout > 3600)
                {
                    throw new WsatAdminException(WsatAdminErrorCode.INVALID_MAXTIMEOUT_ARGUMENT,
                                                 SR.GetString(SR.ErrorMaximumTimeoutRange));
                }
            }
        }
Пример #3
0
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            sb.Append(SR.GetString(SR.ConfigNetworkSupport, Utilities.GetEnabledStatusString(this.TransactionBridgeEnabled || this.TransactionBridge30Enabled)));

            if (this.TransactionBridgeEnabled || this.TransactionBridge30Enabled)
            {
                sb.Append(SR.GetString(SR.ConfigHTTPSPort, this.HttpsPort));
                sb.Append(SR.GetString(SR.ConfigIdentityCertificate,
                                       this.X509Certificate == null ? SR.GetString(SR.ConfigNone) : this.X509Certificate.Thumbprint));
                sb.Append(SR.GetString(SR.ConfigKerberosGACL));
                if (this.KerberosGlobalAcl == null || this.KerberosGlobalAcl.Length < 1)
                {
                    sb.AppendLine(SR.GetString(SR.ConfigNone));
                }
                else
                {
                    int i = 0;
                    foreach (string ace in this.KerberosGlobalAcl)
                    {
                        if (i++ > 0)
                        {
                            sb.Append(SR.GetString(SR.ConfigACEPrefix));
                        }
                        sb.AppendLine(ace);
                    }
                }

                sb.Append(SR.GetString(SR.ConfigAcceptedCertificates));
                if (this.X509GlobalAcl == null || this.X509GlobalAcl.Length < 1)
                {
                    sb.AppendLine(SR.GetString(SR.ConfigNone));
                }
                else
                {
                    int i = 0;
                    foreach (string cert in this.X509GlobalAcl)
                    {
                        if (i++ > 0)
                        {
                            sb.Append(SR.GetString(SR.ConfigAcceptedCertPrefix));
                        }
                        sb.AppendLine(cert);
                    }
                }

                sb.Append(SR.GetString(SR.ConfigDefaultTimeout, this.DefaultTimeout));
                sb.Append(SR.GetString(SR.ConfigMaximumTimeout, this.MaxTimeout));

                SourceLevels level = this.TraceLevel;
                if (level != SourceLevels.All)
                {
                    level = level & ~SourceLevels.ActivityTracing;
                }
                sb.Append(SR.GetString(SR.ConfigTraceLevel, level));
                sb.Append(SR.GetString(SR.ConfigActivityTracing, Utilities.GetEnabledStatusString(this.ActivityTracing)));
                sb.Append(SR.GetString(SR.ConfigActivityProp, Utilities.GetEnabledStatusString(this.ActivityPropagation)));
                sb.Append(SR.GetString(SR.ConfigPiiTracing, Utilities.GetEnabledStatusString(this.TracePii)));

                MsdtcWrapper msdtc = this.GetMsdtcWrapper();
                if (!msdtc.GetNetworkTransactionAccess())
                {
                    sb.Append(Environment.NewLine);
                    sb.Append(SR.GetString(SR.ConfigWarningNetworkDTCAccessIsDisabled));
                }
            }
            else
            {
                // When network support is disabled, the only setting that still matters is the MaxTimeout
                sb.Append(SR.GetString(SR.ConfigMaximumTimeoutWhenNetworkDisabled, this.MaxTimeout));
            }

            return(sb.ToString());
        }