public override void CopyFrom(ServiceModelExtensionElement from)
        {
            base.CopyFrom(from);
            ServiceMetadataPublishingElement element = (ServiceMetadataPublishingElement)from;

            this.HttpGetEnabled               = element.HttpGetEnabled;
            this.HttpGetUrl                   = element.HttpGetUrl;
            this.HttpsGetEnabled              = element.HttpsGetEnabled;
            this.HttpsGetUrl                  = element.HttpsGetUrl;
            this.ExternalMetadataLocation     = element.ExternalMetadataLocation;
            this.PolicyVersion                = element.PolicyVersion;
            this.HttpGetBinding               = element.HttpGetBinding;
            this.HttpGetBindingConfiguration  = element.HttpGetBindingConfiguration;
            this.HttpsGetBinding              = element.HttpsGetBinding;
            this.HttpsGetBindingConfiguration = element.HttpsGetBindingConfiguration;
        }
        public override void CopyFrom(ServiceModelExtensionElement from)
        {
            base.CopyFrom(from);

            ServiceMetadataPublishingElement source = (ServiceMetadataPublishingElement)from;

#pragma warning suppress 56506 //Microsoft; base.CopyFrom() check for 'from' being null
            this.HttpGetEnabled               = source.HttpGetEnabled;
            this.HttpGetUrl                   = source.HttpGetUrl;
            this.HttpsGetEnabled              = source.HttpsGetEnabled;
            this.HttpsGetUrl                  = source.HttpsGetUrl;
            this.ExternalMetadataLocation     = source.ExternalMetadataLocation;
            this.PolicyVersion                = source.PolicyVersion;
            this.HttpGetBinding               = source.HttpGetBinding;
            this.HttpGetBindingConfiguration  = source.HttpGetBindingConfiguration;
            this.HttpsGetBinding              = source.HttpsGetBinding;
            this.HttpsGetBindingConfiguration = source.HttpsGetBindingConfiguration;
        }
Exemplo n.º 3
0
        protected void EnsureComMetaDataExchangeBehaviorAdded(Configuration config)
        {
            ServiceModelSectionGroup sg = ServiceModelSectionGroup.GetSectionGroup(config);
            if (!sg.Behaviors.ServiceBehaviors.ContainsKey(comServiceBehavior))
            {
                ServiceBehaviorElement behavior = new ServiceBehaviorElement(comServiceBehavior);
                sg.Behaviors.ServiceBehaviors.Add(behavior);
                ServiceMetadataPublishingElement metadataPublishing = new ServiceMetadataPublishingElement();

                if (Tool.Options.Hosting == Hosting.Complus || Tool.Options.Hosting == Hosting.NotSpecified)
                    metadataPublishing.HttpGetEnabled = false;
                else
                    metadataPublishing.HttpGetEnabled = true;
                behavior.Add(metadataPublishing);

                ServiceDebugElement serviceDebug = new ServiceDebugElement();
                serviceDebug.IncludeExceptionDetailInFaults = false;
                behavior.Add(serviceDebug);

            }

        }
Exemplo n.º 4
0
		public void ServiceMetadataPublishingElement_defaults () {
			ServiceMetadataPublishingElement element = new ServiceMetadataPublishingElement ();

			Assert.AreEqual (typeof (ServiceMetadataBehavior), element.BehaviorType, "BehaviorType");
			Assert.AreEqual ("serviceMetadata", element.ConfigurationElementName, "ConfigurationElementName");

			Assert.AreEqual (false, element.HttpGetEnabled, "HttpGetEnabled");
			Assert.AreEqual (null, element.HttpGetUrl, "HttpGetUrl");
			Assert.AreEqual (false, element.HttpsGetEnabled, "HttpsGetEnabled");
			Assert.AreEqual (null, element.HttpsGetUrl, "HttpsGetUrl");
			Assert.AreEqual (null, element.ExternalMetadataLocation, "ExternalMetadataLocation");
			Assert.AreEqual (PolicyVersion.Default, element.PolicyVersion, "PolicyVersion");
		}