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
        ContractDescription ResolveIMetadataExchangeToContract()
        {
            // Use ServiceModel's TypeLoader to load the IMetadataExchange contract
            TypeLoader typeLoader = new TypeLoader();

            return(typeLoader.LoadContractDescription(typeof(IMetadataExchange)));
        }
 public static ContractDescription GetContract(Type contractType)
 {
     if (contractType == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("contractType");
     }
     TypeLoader loader = new TypeLoader();
     return loader.LoadContractDescription(contractType);
 }
        public static ContractDescription GetContract(Type contractType)
        {
            if (contractType == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("contractType");
            }
            TypeLoader loader = new TypeLoader();

            return(loader.LoadContractDescription(contractType));
        }
Esempio n. 5
0
        public static ContractDescription GetContract <TService>(Type contractType) where TService : class
        {
            if (contractType == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(contractType));
            }

            var typeLoader = new TypeLoader <TService>();
            ContractDescription description = typeLoader.LoadContractDescription(contractType);

            return(description);
        }
        public static ContractDescription GetContract(Type contractType, object serviceImplementation)
        {
            if (contractType == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("contractType");
            }
            if (serviceImplementation == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("serviceImplementation");
            }
            TypeLoader loader      = new TypeLoader();
            Type       serviceType = serviceImplementation.GetType();

            return(loader.LoadContractDescription(contractType, serviceType, serviceImplementation));
        }
Esempio n. 7
0
        public static ContractDescription GetContract(Type contractType, Type serviceType)
        {
            if (contractType == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("contractType");
            }

            if (serviceType == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("serviceType");
            }

            TypeLoader          typeLoader  = new TypeLoader();
            ContractDescription description = typeLoader.LoadContractDescription(contractType, serviceType);

            return(description);
        }
Esempio n. 8
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);
        }
Esempio n. 9
0
        public static ContractDescription GetContract(Type contractType, object serviceImplementation)
        {
            if (contractType == null)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("contractType");

            if (serviceImplementation == null)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("serviceImplementation");

            TypeLoader typeLoader = new TypeLoader();
            Type serviceType = serviceImplementation.GetType();
            ContractDescription description = typeLoader.LoadContractDescription(contractType, serviceType, serviceImplementation);
            return description;
        }
 private ContractDescription ResolveIMetadataExchangeToContract()
 {
     TypeLoader loader = new TypeLoader();
     return loader.LoadContractDescription(typeof(IMetadataExchange));
 }
        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;
        }
 ContractDescription ResolveIMetadataExchangeToContract()
 {
     // Use ServiceModel's TypeLoader to load the IMetadataExchange contract
     TypeLoader typeLoader = new TypeLoader();
     return typeLoader.LoadContractDescription(typeof(IMetadataExchange));
 }
Esempio n. 13
0
        private ContractDescription ResolveIMetadataExchangeToContract()
        {
            TypeLoader loader = new TypeLoader();

            return(loader.LoadContractDescription(typeof(IMetadataExchange)));
        }