// See https://aka.ms/new-console-template for more information using RankingServer; using CoreWCF.Configuration; using CoreWCF.Description; using CoreWCF; using System.Net; WebApplicationBuilder builder = WebApplication.CreateBuilder(args); builder.WebHost .ConfigureKestrel( (context, options) => { options.AllowSynchronousIO = true; }) .UseKestrel( (context, options) => { options.Listen(IPAddress.Loopback, 5000); options.Listen( IPAddress.Loopback, 5001, listenOptions => { listenOptions.UseHttps(); }); }); // Add support builder.Services.AddServiceModelServices().AddServiceModelMetadata(); builder.Services.AddSingleton(); builder.Services.AddAuthorization(); builder.Services.AddAuthentication(); WebApplication app = builder.Build(); app.UseServiceModel( builder => { builder .AddService((serviceOptions) => { }) .AddServiceEndpoint(new BasicHttpBinding(), "/RankingService/basichttp") .AddServiceEndpoint(new WSHttpBinding(SecurityMode.Transport), "/RankingService/WSHttps"); }); ServiceMetadataBehavior serviceMetadataBehavior = app.Services.GetRequiredService(); serviceMetadataBehavior.HttpGetEnabled = true; app.Logger.LogInformation("Starting Ranking Service…"); app.Run();