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);
 }
Ejemplo n.º 3
0
        protected void InitializeDescription(UriSchemeKeyedCollection baseAddresses)
        {
            this.base_addresses = baseAddresses;
            IDictionary <string, ContractDescription> retContracts;

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

            ApplyConfiguration();
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
 }
Ejemplo n.º 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;
        }
Ejemplo n.º 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));
        }
Ejemplo n.º 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());
        }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 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());
            }
        }