示例#1
0
        // Config has changed
        public virtual void OnAfterConfigChanged()
        {
            config.ServiceEndpointsMetadataConfig = ServiceEndpointsMetadataConfig.Create(config.HandlerFactoryPath);

            JsonDataContractSerializer.Instance.UseBcl = config.UseBclJsonSerializers;
            JsonDataContractSerializer.Instance.UseBcl = config.UseBclJsonSerializers;
        }
示例#2
0
        public void OnTestFixtureSetUp()
        {
            appHost = new OperationTestsAppHost();
            appHost.Init();

            var dummyServiceType = GetType();

            appHost.Metadata.Add(dummyServiceType, typeof(GetCustomer), typeof(GetCustomerResponse));
            appHost.Metadata.Add(dummyServiceType, typeof(GetCustomers), typeof(GetCustomersResponse));
            appHost.Metadata.Add(dummyServiceType, typeof(StoreCustomer), null);

            operationControl = new OperationControl
            {
                HttpRequest = new MockHttpRequest {
                    PathInfo = "", RawUrl = "http://localhost:4444/metadata"
                },
                MetadataConfig  = ServiceEndpointsMetadataConfig.Create(""),
                Format          = Format.Json,
                HostName        = "localhost",
                RequestMessage  = "(string)",
                ResponseMessage = "(HttpWebResponse)",
                Title           = "Metadata page",
                OperationName   = "operationname",
                MetadataHtml    = "<p>Operation</p>"
            };
        }
        public MetadataPagesConfig(
            ServiceMetadata metadata,
            ServiceEndpointsMetadataConfig metadataConfig,
            HashSet <string> ignoredFormats,
            List <string> contentTypeFormats)
        {
            this.ignoredFormats = ignoredFormats;
            this.metadata       = metadata;

            metadataConfigMap = new Dictionary <string, MetadataConfig> {
                { "xml", metadataConfig.Xml },
                { "json", metadataConfig.Json },
                { "jsv", metadataConfig.Jsv },
                { "soap11", metadataConfig.Soap11 },
                { "soap12", metadataConfig.Soap12 },
            };

            AvailableFormatConfigs = new List <MetadataConfig>();

            var config = GetMetadataConfig("xml");

            if (config != null)
            {
                AvailableFormatConfigs.Add(config);
            }
            config = GetMetadataConfig("json");
            if (config != null)
            {
                AvailableFormatConfigs.Add(config);
            }
            config = GetMetadataConfig("jsv");
            if (config != null)
            {
                AvailableFormatConfigs.Add(config);
            }

            foreach (var format in contentTypeFormats)
            {
                metadataConfigMap[format] = metadataConfig.Custom.Create(format);

                config = GetMetadataConfig(format);
                if (config != null)
                {
                    AvailableFormatConfigs.Add(config);
                }
            }

            config = GetMetadataConfig("soap11");
            if (config != null)
            {
                AvailableFormatConfigs.Add(config);
            }
            config = GetMetadataConfig("soap12");
            if (config != null)
            {
                AvailableFormatConfigs.Add(config);
            }
        }
示例#4
0
 public ServiceMetadata()
 {
     this.RequestTypes          = new HashSet <Type>();
     this.ServiceTypes          = new HashSet <Type>();
     this.ResponseTypes         = new HashSet <Type>();
     this.OperationsMap         = new Dictionary <Type, Operation>();
     this.OperationsResponseMap = new Dictionary <Type, Operation>();
     this.OperationNamesMap     = new Dictionary <string, Operation>();
     this.Config = ServiceEndpointsMetadataConfig.Create(string.Empty);
 }
示例#5
0
        public void OnTestFixtureSetUp()
        {
            _appHost = new OperationTestsAppHost();
            _appHost.Init();

            _operationControl = new OperationControl
            {
                HttpRequest = new MockHttpRequest {
                    PathInfo = "", RawUrl = "http://localhost:4444/metadata"
                },
                MetadataConfig  = ServiceEndpointsMetadataConfig.Create(""),
                Format          = Format.Json,
                HostName        = "localhost",
                RequestMessage  = "(string)",
                ResponseMessage = "(HttpWebResponse)",
                Title           = "Metadata page",
                OperationName   = "operationname",
                MetadataHtml    = "<p>Operation</p>"
            };
        }