예제 #1
0
        public static void Configure(ServiceConfiguration config)
        {
            NetTcpBinding binding = new NetTcpBinding();

            binding.Security.Mode = SecurityMode.None;

            ServiceEndpoint accessPointEndpoint = new ServiceEndpoint(ContractDescription.GetContract(typeof(IAccessPoint)),
                                                                      binding, new EndpointAddress("net.tcp://localhost:" + NetHelper.Port.ToString() + Constants.AccessPoint));

            config.AddServiceEndpoint(accessPointEndpoint);

            ServiceEndpoint streamServerEndpoint = new ServiceEndpoint(ContractDescription.GetContract(typeof(IStreamServer)),
                                                                       StreamedTcpBinding(), new EndpointAddress("net.tcp://localhost:" + NetHelper.Port.ToString() + Constants.StreamServer));

            streamServerEndpoint.EndpointBehaviors.Add(new DispatcherSynchronizationBehavior {
                AsynchronousSendEnabled = true, MaxPendingReceives = 10
            });
            config.AddServiceEndpoint(streamServerEndpoint);

            config.Description.Behaviors.Add(new ServiceMetadataBehavior {
                HttpGetEnabled = false, HttpsGetEnabled = false
            });

            //ServiceThrottlingBehavior stb = new ServiceThrottlingBehavior
            //{
            //    MaxConcurrentSessions = 100,
            //    MaxConcurrentCalls = 100,
            //    MaxConcurrentInstances = 100
            //};
            //config.Description.Behaviors.Add(stb);
        }
예제 #2
0
 public static void Configure(ServiceConfiguration config)
 {
     var tcpAddr = new Uri("net.tcp://localhost:880/EntityService");
     //var se = new ServiceEndpoint(new ContractDescription("IEntityService"), new NetTcpBinding(), new EndpointAddress(tcpAddr));
     //config.AddServiceEndpoint(se);
     config.Description.Behaviors.Add(new ServiceDebugBehavior { IncludeExceptionDetailInFaults = true });
     config.AddServiceEndpoint(typeof (IEntityService), new NetTcpBinding(), tcpAddr);
 }
예제 #3
0
파일: WcfServer.cs 프로젝트: ojji/peoneer
 public static void Configure(ServiceConfiguration config)
 {
     config.AddServiceEndpoint(typeof(IMessageProcessor), new WSHttpBinding(), new Uri(StartupUri));
     var serviceMetadataBehavior = new ServiceMetadataBehavior
     {
         HttpGetUrl = new Uri(StartupUri),
         HttpGetEnabled = true,
         MetadataExporter = {PolicyVersion = PolicyVersion.Policy15}
     };
     config.Description.Behaviors.Add(serviceMetadataBehavior);
 }
예제 #4
0
        public static void Configure(ServiceConfiguration config)
        {
            var tcpAddr = new Uri("net.tcp://localhost:880/EntityService");

            //var se = new ServiceEndpoint(new ContractDescription("IEntityService"), new NetTcpBinding(), new EndpointAddress(tcpAddr));
            //config.AddServiceEndpoint(se);
            config.Description.Behaviors.Add(new ServiceDebugBehavior {
                IncludeExceptionDetailInFaults = true
            });
            config.AddServiceEndpoint(typeof(IEntityService), new NetTcpBinding(), tcpAddr);
        }
        public void ConfigureService(ServiceConfiguration configuration)
        {
            configuration.InjectAutoMapper();
            configuration.InjectServiceBase();

            //configuration.AddConfiguration<List<DbSettings>>();
            // Your services and repositories go here
            configuration.Inject <IMicroServiceTemplateRepository, MicroServiceTemplateRepository>();
            configuration.Inject <IMicroServiceTemplateService, MicroServiceTemplateService>();

            configuration.AddServiceEndpoint <MicroServiceTemplateEndpointSample>();
        }
예제 #6
0
        public static void Configure(ServiceConfiguration config)
        {
            config.AddServiceEndpoint(typeof(IMessageProcessor), new WSHttpBinding(), new Uri(StartupUri));
            var serviceMetadataBehavior = new ServiceMetadataBehavior
            {
                HttpGetUrl       = new Uri(StartupUri),
                HttpGetEnabled   = true,
                MetadataExporter = { PolicyVersion = PolicyVersion.Policy15 }
            };

            config.Description.Behaviors.Add(serviceMetadataBehavior);
        }
예제 #7
0
        public static void Configure(ServiceConfiguration config)
        {
            var binding = new NetTcpBinding(SecurityMode.Transport, true);

            config.EnableProtocol(binding);

            config.AddServiceEndpoint(new UdpDiscoveryEndpoint());

            ServiceDiscoveryBehavior serviceDiscoveryBehavior = new ServiceDiscoveryBehavior();

            serviceDiscoveryBehavior.AnnouncementEndpoints.Add(new UdpAnnouncementEndpoint());
            config.Description.Behaviors.Add(serviceDiscoveryBehavior);
        }
        public static void Configure(ServiceConfiguration config)
        {
            string address = config.BaseAddresses.First().AbsoluteUri;

            ServiceConfigurationManager manager = new ServiceConfigurationManager();

            ContractDescription contract = ContractDescription.GetContract(typeof(IService));
            ServiceEndpoint     endpoint = new ServiceEndpoint(contract, manager.CreateBinding(), new EndpointAddress(address));

            config.AddServiceEndpoint(endpoint);
            //config.AddServiceEndpoint(manager.CreateServiceEndpoint(address));

            config.Description.Behaviors.Add(new ServiceMetadataBehavior {
                HttpGetEnabled = true
            });
            config.Description.Behaviors.Add(new ServiceDebugBehavior {
                IncludeExceptionDetailInFaults = true
            });
        }
예제 #9
0
        public static ServiceConfiguration ApplyCustomAuthentication
            (this ServiceConfiguration config, Type serviceType, string address)
        {
            config.Credentials.IdentityConfiguration    = CreateIdentityConfiguration();
            config.Credentials.UseIdentityConfiguration = true;
            config.Description.Behaviors.Add(new ServiceMetadataBehavior {
                HttpGetEnabled = true
            });
            config.Description.Behaviors.Add(new ServiceDebugBehavior {
                IncludeExceptionDetailInFaults = true
            });

            var behavior = new ServiceAuthorizationBehavior
            {
                PrincipalPermissionMode = PrincipalPermissionMode.Always
            };

            config.Description.Behaviors.Add(behavior);

            config.AddServiceEndpoint(serviceType, ServiceBinding.CreateBinding(), address);
            return(config);
        }
 private static void InjectWebEndpoints(ServiceConfiguration configuration)
 {
     configuration.AddServiceEndpoint <IdentityWebEndpoint>();
 }
예제 #11
0
 public void ConfigureService(ServiceConfiguration configuration)
 {
     configuration.AddServiceEndpoint <DummyEndpoint>();
 }