Exemplo n.º 1
0
        /// <summary>
        /// Gets the enpoint address for a service host
        /// </summary>
        /// <param name="isController">indicating whether controller address is required</param>
        /// <returns>endpoint address</returns>
        protected override EndpointAddress GetEndpointAddress(bool isController)
        {
            string hostnameWithPrefix = this.MachineName;
            int    port = PortHelper.ConvertToPort(this.firstCoreId, isController);

            // BUG FIX 2833 : Use localhost when communicating with local servicehost to get around security negotiation errors
            // For http backend, we must build the epr with real machine name
            if (!this.isHttp && IsThisBrokerNode(this.MachineName))
            {
                hostnameWithPrefix = "localhost";
            }
            else if (!String.IsNullOrEmpty(this.networkPrefix))
            {
                hostnameWithPrefix = string.Format(CultureInfo.InvariantCulture, "{0}.{1}", this.networkPrefix, hostnameWithPrefix);
            }

            string epr = BindingHelper.GenerateServiceHostEndpointAddress(hostnameWithPrefix, this.jobId, this.taskId, port, this.isHttp) + Constant.ServiceHostEndpointPath;

            if (isController)
            {
                epr += Constant.ServiceHostControllerEndpointPath;
            }

            return(new EndpointAddress(epr));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets the enpoint address for a service host
        /// </summary>
        /// <param name="isController">indicating whether controller address is required</param>
        /// <returns>endpoint address</returns>
        protected override EndpointAddress GetEndpointAddress(bool isController)
        {
            string hostnameWithPrefix = this.MachineName;
            int    port = PortHelper.ConvertToPort(this.firstCoreId, isController);

            if (!String.IsNullOrEmpty(this.networkPrefix))
            {
                hostnameWithPrefix = string.Format(CultureInfo.InvariantCulture, "{0}.{1}", this.networkPrefix, hostnameWithPrefix);
            }

            string epr = BindingHelper.GenerateServiceHostEndpointAddress(hostnameWithPrefix, this.jobId, this.taskId, port, this.isHttp) + Constant.ServiceHostEndpointPath;

            if (isController)
            {
                epr += Constant.ServiceHostControllerEndpointPath;
                BrokerTracing.TraceVerbose("[WssDispatcherInfo]. Service host controller EPR = {0}.", epr);
            }
            else
            {
                BrokerTracing.TraceVerbose("[WssDispatcherInfo]. Service host EPR = {0}.", epr);
            }

            return(new EndpointAddress(
                       new Uri(epr),
                       EndpointIdentity.CreateDnsIdentity(Constant.HpcWssServiceIdentity),
                       new AddressHeaderCollection()
                       ));
        }