コード例 #1
0
        // Service host startup logic.
        private static void Listen()
        {
            const int maxReceivedMessageSize = ushort.MaxValue;
            const int maxStringContentLength = ushort.MaxValue;

            var binding = new WSHttpBinding
            {
                MaxReceivedMessageSize = maxReceivedMessageSize,
                ReaderQuotas           = { MaxStringContentLength = maxStringContentLength }
            };

            var behavior = new ServiceMetadataBehavior
            {
                HttpGetEnabled   = true,
                MetadataExporter = { PolicyVersion = PolicyVersion.Policy15 }
            };

            serviceHost = new ExternalServiceHost(args, typeof(ExternalService), new Uri(ServiceUri));
            serviceHost.AddServiceEndpoint(typeof(IExternalService), binding, string.Empty);
            serviceHost.Description.Behaviors.Add(behavior);
            serviceHost.Open();
        }
コード例 #2
0
        // Service host startup logic.
        private static void Listen()
        {
            const int maxReceivedMessageSize = ushort.MaxValue;
            const int maxStringContentLength = ushort.MaxValue;

            var binding = new WSHttpBinding
            {
                MaxReceivedMessageSize = maxReceivedMessageSize,
                ReaderQuotas = { MaxStringContentLength = maxStringContentLength }
            };

            var behavior = new ServiceMetadataBehavior
            {
                HttpGetEnabled = true,
                MetadataExporter = { PolicyVersion = PolicyVersion.Policy15 }
            };

            serviceHost = new ExternalServiceHost(args, typeof(ExternalService), new Uri(ServiceUri));
            serviceHost.AddServiceEndpoint(typeof(IExternalService), binding, string.Empty);
            serviceHost.Description.Behaviors.Add(behavior);
            serviceHost.Open();
        }