Ejemplo n.º 1
0
        void InitializeForMarshal(WhereaboutsReader whereabouts)
        {
            ProtocolInformationReader protocol = whereabouts.ProtocolInformation;

            if (protocol != null && protocol.NetworkOutboundAccess)
            {
                // We can marshal outgoing transactions using a valid address
                if (protocol.IsV10Enabled)
                {
                    UriBuilder builder10 = new UriBuilder(Uri.UriSchemeHttps,
                                                          protocol.HostName,
                                                          protocol.HttpsPort,
                                                          protocol.BasePath + "/" +
                                                          BindingStrings.RegistrationCoordinatorSuffix(ProtocolVersion.Version10));
                    this.registrationServiceAddress10 = builder10.Uri;
                }

                // when we have a WSAT1.1 coordinator
                if (protocol.IsV11Enabled)
                {
                    UriBuilder builder11 = new UriBuilder(Uri.UriSchemeHttps,
                                                          protocol.HostName,
                                                          protocol.HttpsPort,
                                                          protocol.BasePath + "/" +
                                                          BindingStrings.RegistrationCoordinatorSuffix(ProtocolVersion.Version11));

                    this.registrationServiceAddress11 = builder11.Uri;
                }

                this.issuedTokensEnabled = protocol.IssuedTokensEnabled;
                this.maxTimeout          = protocol.MaxTimeout;
            }
            else
            {
                // Generate an address that will not work
                // We do this in order to generate coordination contexts that can be propagated
                // between processes on the same node even if WS-AT is disabled
                UriBuilder builder = new UriBuilder(Uri.UriSchemeHttps,
                                                    whereabouts.HostName,
                                                    443,
                                                    DisabledRegistrationPath);

                this.registrationServiceAddress10 = builder.Uri;
                this.registrationServiceAddress11 = builder.Uri;
                this.issuedTokensEnabled          = false;
                this.maxTimeout = TimeSpan.FromMinutes(5);
            }
        }
Ejemplo n.º 2
0
        private void InitializeForUnmarshal(WhereaboutsReader whereabouts)
        {
            ProtocolInformationReader protocolInformation = whereabouts.ProtocolInformation;

            if ((protocolInformation != null) && protocolInformation.NetworkInboundAccess)
            {
                string str;
                this.inboundEnabled = true;
                bool   flag   = string.Compare(Environment.MachineName, protocolInformation.NodeName, StringComparison.OrdinalIgnoreCase) == 0;
                string suffix = BindingStrings.ActivationCoordinatorSuffix(ProtocolVersion.Version10);
                string str3   = BindingStrings.ActivationCoordinatorSuffix(ProtocolVersion.Version11);
                if (protocolInformation.IsClustered || (protocolInformation.NetworkClientAccess && !flag))
                {
                    if (protocolInformation.IsClustered)
                    {
                        str = null;
                    }
                    else
                    {
                        str = "host/" + protocolInformation.HostName;
                    }
                    if (protocolInformation.IsV10Enabled)
                    {
                        this.remoteActivationService10 = this.CreateActivationEndpointAddress(protocolInformation, suffix, str, true);
                    }
                    if (protocolInformation.IsV11Enabled)
                    {
                        this.remoteActivationService11 = this.CreateActivationEndpointAddress(protocolInformation, str3, str, true);
                    }
                }
                if (flag)
                {
                    str = "host/" + protocolInformation.NodeName;
                    if (protocolInformation.IsV10Enabled)
                    {
                        this.localActivationService10 = this.CreateActivationEndpointAddress(protocolInformation, suffix, str, false);
                    }
                    if (protocolInformation.IsV11Enabled)
                    {
                        this.localActivationService11 = this.CreateActivationEndpointAddress(protocolInformation, str3, str, false);
                    }
                }
            }
        }
Ejemplo n.º 3
0
        private void InitializeForMarshal(WhereaboutsReader whereabouts)
        {
            ProtocolInformationReader protocolInformation = whereabouts.ProtocolInformation;

            if ((protocolInformation != null) && protocolInformation.NetworkOutboundAccess)
            {
                if (protocolInformation.IsV10Enabled)
                {
                    UriBuilder builder = new UriBuilder(Uri.UriSchemeHttps, protocolInformation.HostName, protocolInformation.HttpsPort, protocolInformation.BasePath + "/" + BindingStrings.RegistrationCoordinatorSuffix(ProtocolVersion.Version10));
                    this.registrationServiceAddress10 = builder.Uri;
                }
                if (protocolInformation.IsV11Enabled)
                {
                    UriBuilder builder2 = new UriBuilder(Uri.UriSchemeHttps, protocolInformation.HostName, protocolInformation.HttpsPort, protocolInformation.BasePath + "/" + BindingStrings.RegistrationCoordinatorSuffix(ProtocolVersion.Version11));
                    this.registrationServiceAddress11 = builder2.Uri;
                }
                this.issuedTokensEnabled = protocolInformation.IssuedTokensEnabled;
                this.maxTimeout          = protocolInformation.MaxTimeout;
            }
            else
            {
                UriBuilder builder3 = new UriBuilder(Uri.UriSchemeHttps, whereabouts.HostName, 0x1bb, DisabledRegistrationPath);
                this.registrationServiceAddress10 = builder3.Uri;
                this.registrationServiceAddress11 = builder3.Uri;
                this.issuedTokensEnabled          = false;
                this.maxTimeout = TimeSpan.FromMinutes(5.0);
            }
        }
Ejemplo n.º 4
0
 static WsatConfiguration()
 {
     DisabledRegistrationPath = string.Concat(BindingStrings.AddressPrefix, "/", BindingStrings.RegistrationCoordinatorSuffix(ProtocolVersion.Version10), BindingStrings.DisabledSuffix);
 }
Ejemplo n.º 5
0
        void InitializeForUnmarshal(WhereaboutsReader whereabouts)
        {
            ProtocolInformationReader protocol = whereabouts.ProtocolInformation;

            if (protocol != null && protocol.NetworkInboundAccess)
            {
                this.inboundEnabled = true;

                bool isTmLocal = string.Compare(Environment.MachineName,
                                                protocol.NodeName,
                                                StringComparison.OrdinalIgnoreCase) == 0;

                string spnIdentity;

                string activationCoordinatorSuffix10 =
                    BindingStrings.ActivationCoordinatorSuffix(ProtocolVersion.Version10);

                string activationCoordinatorSuffix11 =
                    BindingStrings.ActivationCoordinatorSuffix(ProtocolVersion.Version11);

                if (protocol.IsClustered ||
                    (protocol.NetworkClientAccess && !isTmLocal))
                {
                    if (protocol.IsClustered)
                    {
                        // We cannot reliably perform mutual authentication against a clustered resource
                        // See MB 43523 for more details on this

                        spnIdentity = null;
                    }
                    else
                    {
                        spnIdentity = "host/" + protocol.HostName;
                    }

                    if (protocol.IsV10Enabled)
                    {
                        this.remoteActivationService10 = CreateActivationEndpointAddress(protocol,
                                                                                         activationCoordinatorSuffix10,
                                                                                         spnIdentity,
                                                                                         true);
                    }

                    if (protocol.IsV11Enabled)
                    {
                        this.remoteActivationService11 = CreateActivationEndpointAddress(protocol,
                                                                                         activationCoordinatorSuffix11,
                                                                                         spnIdentity,
                                                                                         true);
                    }
                }

                if (isTmLocal)
                {
                    spnIdentity = "host/" + protocol.NodeName;

                    // The net.pipe Activation endpoint uses the host name as a discriminant
                    // for cluster scenarios with more than one service on a node.
                    if (protocol.IsV10Enabled)
                    {
                        this.localActivationService10 = CreateActivationEndpointAddress(protocol,
                                                                                        activationCoordinatorSuffix10,
                                                                                        spnIdentity,
                                                                                        false);
                    }

                    if (protocol.IsV11Enabled)
                    {
                        this.localActivationService11 = CreateActivationEndpointAddress(protocol,
                                                                                        activationCoordinatorSuffix11,
                                                                                        spnIdentity,
                                                                                        false);
                    }
                }
            }
        }