protected void InitializeDescription(System.Type serviceType, UriSchemeKeyedCollection baseAddresses)
 {
     if (serviceType == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("serviceType"));
     }
     this.serviceType = serviceType;
     base.InitializeDescription(baseAddresses);
 }
 protected void InitializeDescription(object singletonInstance, UriSchemeKeyedCollection baseAddresses)
 {
     if (singletonInstance == null)
     {
         throw new ArgumentNullException("singletonInstance");
     }
     this.singletonInstance = singletonInstance;
     this.InitializeDescription(singletonInstance.GetType(), baseAddresses);
 }
Пример #3
0
        protected void InitializeDescription(UriSchemeKeyedCollection baseAddresses)
        {
            this.base_addresses = baseAddresses;
            IDictionary <string, ContractDescription> retContracts;

            description = CreateDescription(out retContracts);
            contracts   = retContracts;

            ApplyConfiguration();
        }
Пример #4
0
        protected void InitializeDescription(Type serviceType, UriSchemeKeyedCollection baseAddresses)
        {
            if (!serviceType.IsClass)
            {
                throw new ArgumentException("ServiceHost only supports 'class' service types.");
            }

            service_type = serviceType;

            InitializeDescription(baseAddresses);
        }
Пример #5
0
 protected ServiceHostBase()
 {
     TraceUtility.SetEtwProviderId();
     this.baseAddresses      = new UriSchemeKeyedCollection(base.ThisLock);
     this.channelDispatchers = new ChannelDispatcherCollection(this, base.ThisLock);
     this.extensions         = new ExtensionCollection <ServiceHostBase>(this, base.ThisLock);
     this.instances          = new InstanceContextManager(base.ThisLock);
     this.serviceThrottle    = new System.ServiceModel.Dispatcher.ServiceThrottle(this);
     base.TraceOpenAndClose  = true;
     base.Faulted           += new EventHandler(this.OnServiceHostFaulted);
 }
Пример #6
0
        protected void InitializeDescription(UriSchemeKeyedCollection baseAddresses)
        {
            foreach (Uri uri in baseAddresses)
            {
                this.baseAddresses.Add(uri);
            }
            IDictionary <string, ContractDescription> implementedContracts = null;

            System.ServiceModel.Description.ServiceDescription description = this.CreateDescription(out implementedContracts);
            this.description          = description;
            this.implementedContracts = implementedContracts;
            this.ApplyConfiguration();
            this.initializeDescriptionHasFinished = true;
        }
Пример #7
0
        internal static Uri GetVia(string scheme, Uri address, UriSchemeKeyedCollection baseAddresses)
        {
            Uri uri = address;

            if (uri.IsAbsoluteUri)
            {
                return(uri);
            }
            if (!baseAddresses.Contains(scheme))
            {
                return(null);
            }
            return(GetUri(baseAddresses[scheme], address));
        }
Пример #8
0
        internal static string GetBaseAddressSchemes(UriSchemeKeyedCollection uriSchemeKeyedCollection)
        {
            StringBuilder builder = new StringBuilder();
            bool          flag    = true;

            foreach (Uri uri in uriSchemeKeyedCollection)
            {
                if (flag)
                {
                    builder.Append(uri.Scheme);
                    flag = false;
                }
                else
                {
                    builder.Append(CultureInfo.CurrentCulture.TextInfo.ListSeparator).Append(uri.Scheme);
                }
            }
            return(builder.ToString());
        }
Пример #9
0
 protected void InitializeDescription(object singletonInstance, UriSchemeKeyedCollection baseAddresses)
 {
     instance = singletonInstance;
     InitializeDescription(singletonInstance.GetType(), baseAddresses);
 }
 protected void InitializeDescription(Object singletonInstance, UriSchemeKeyedCollection baseAddresses)
 {
     Contract.Requires(baseAddresses != null);
 }
 protected void InitializeDescription(Type serviceType, UriSchemeKeyedCollection baseAddresses)
 {
     Contract.Requires(baseAddresses != null);
 }
Пример #12
0
        internal static Uri MakeAbsoluteUri(Uri relativeOrAbsoluteUri, Binding binding, UriSchemeKeyedCollection baseAddresses)
        {
            Uri address = relativeOrAbsoluteUri;

            if (!address.IsAbsoluteUri)
            {
                if (binding.Scheme == string.Empty)
                {
                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(System.ServiceModel.SR.GetString("SFxCustomBindingWithoutTransport")));
                }
                address = GetVia(binding.Scheme, address, baseAddresses);
                if (address == null)
                {
                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(System.ServiceModel.SR.GetString("SFxEndpointNoMatchingScheme", new object[] { binding.Scheme, binding.Name, GetBaseAddressSchemes(baseAddresses) })));
                }
            }
            return(address);
        }
Пример #13
0
        void InitializeDescription(WorkflowDefinitionContext workflowDefinitionContext, UriSchemeKeyedCollection baseAddresses)
        {
            this.workflowDefinitionContext = workflowDefinitionContext;
            this.InitializeDescription(baseAddresses);

            if (!this.Description.Behaviors.Contains(typeof(WorkflowRuntimeBehavior)))
            {
                this.Description.Behaviors.Add(new WorkflowRuntimeBehavior());
            }
        }