Exemplo n.º 1
0
        protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses)
        {
            ServiceHost host = null;

            WfServiceContractMapElement element = WfServiceContractMapSettings.GetConfig().Maps[serviceType.FullName];

            if (element == null || string.IsNullOrEmpty(element.ContractName))
            {
                //If not mapped, using tranditional host.
                host = new ServiceHost(serviceType, baseAddresses);
            }
            else
            {
                host = new WfServiceHost(serviceType, baseAddresses, element.ContractName, element.AtlasEnabled, element.BindingMode);

                if (element.Debug)
                {
                    var dbgBehavior = host.Description.Behaviors.GetBehavior <ServiceDebugBehavior>();

                    dbgBehavior.IncludeExceptionDetailInFaults = true;
                }
            }

            return(host);
        }
		protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses)
		{
			ServiceHost host = null;

			WfServiceContractMapElement element = WfServiceContractMapSettings.GetConfig().Maps[serviceType.FullName];

			if (element == null || string.IsNullOrEmpty(element.ContractName))
			{
				//If not mapped, using tranditional host.
				host = new ServiceHost(serviceType, baseAddresses);
			}
			else
			{
				host = new WfServiceHost(serviceType, baseAddresses, element.ContractName, element.AtlasEnabled, element.BindingMode);

				if (element.Debug)
				{
					var dbgBehavior = host.Description.Behaviors.GetBehavior<ServiceDebugBehavior>();

					dbgBehavior.IncludeExceptionDetailInFaults = true;
				}
			}

			return host;
		}