Esempio n. 1
0
        private ServiceEndpoint CreateServiceEndpoint()
        {
            TypeLoader          loader = new TypeLoader();
            ContractDescription contractDescription = loader.LoadContractDescription(contractType);

            ServiceEndpoint endpoint = new ServiceEndpoint(contractDescription);

            if (address != null)
            {
                endpoint.Address = new EndpointAddress(new Uri(address), identity);
            }
            if (binding != null)
            {
                endpoint.Binding = binding;
            }

            if (configurationName != null)
            {
                ConfigLoader configLoader = new ConfigLoader();
                configLoader.LoadChannelBehaviors(endpoint, configurationName);
            }

            ComPlusTypedChannelBuilderTrace.Trace(TraceEventType.Verbose, TraceCode.ComIntegrationTypedChannelBuilderLoaded,
                                                  SR.TraceCodeComIntegrationTypedChannelBuilderLoaded, contractType, binding);

            return(endpoint);
        }
Esempio n. 2
0
        private ServiceEndpoint CreateServiceEndpoint()
        {
            TypeLoader      loader          = new TypeLoader();
            ServiceEndpoint serviceEndpoint = new ServiceEndpoint(loader.LoadContractDescription(this.contractType));

            if (this.address != null)
            {
                serviceEndpoint.Address = new EndpointAddress(new Uri(this.address), this.identity, new AddressHeader[0]);
            }
            if (this.binding != null)
            {
                serviceEndpoint.Binding = this.binding;
            }
            if (this.configurationName != null)
            {
                new ConfigLoader().LoadChannelBehaviors(serviceEndpoint, this.configurationName);
            }
            ComPlusTypedChannelBuilderTrace.Trace(TraceEventType.Verbose, 0x5001e, "TraceCodeComIntegrationTypedChannelBuilderLoaded", this.contractType, this.binding);
            return(serviceEndpoint);
        }