From db059ef5913e328886bb7e34e4f32fa175bed0e5 Mon Sep 17 00:00:00 2001 From: Rene Evertz Date: Tue, 30 Jun 2026 11:20:33 +0200 Subject: [PATCH] auskommentiert --- Service/ServiceContracts/IApiService.cs | 8 +- .../ServiceImplementations/ApiServiceImp.cs | 105 +++++++++--------- 2 files changed, 59 insertions(+), 54 deletions(-) diff --git a/Service/ServiceContracts/IApiService.cs b/Service/ServiceContracts/IApiService.cs index da50fc5cc..b5d96d1d4 100644 --- a/Service/ServiceContracts/IApiService.cs +++ b/Service/ServiceContracts/IApiService.cs @@ -16,10 +16,10 @@ namespace BeWo.Service.ServiceContracts [ServiceContract] public interface IApiService { - [OperationContract] - [WebGet(UriTemplate = "/Test", ResponseFormat = WebMessageFormat.Json)] - [RequireApiAuthorization(IgnoreTenant = true)] - ApiResponse Test(); + //[OperationContract] + //[WebGet(UriTemplate = "/Test", ResponseFormat = WebMessageFormat.Json)] + //[RequireApiAuthorization(IgnoreTenant = true)] + //ApiResponse Test(); [OperationContract] [WebInvoke(UriTemplate = "/GetGkvSum", Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)] diff --git a/Service/ServiceImplementations/ApiServiceImp.cs b/Service/ServiceImplementations/ApiServiceImp.cs index fb329f004..520235815 100644 --- a/Service/ServiceImplementations/ApiServiceImp.cs +++ b/Service/ServiceImplementations/ApiServiceImp.cs @@ -28,56 +28,7 @@ namespace BeWo.Service.ServiceImplementations { try { - var winIdentity = WindowsIdentity.GetCurrent(); - var securityContext = ServiceSecurityContext.Current; - var principal = Thread.CurrentPrincipal; - - var proc = Process.GetCurrentProcess(); - - var ipInfo = OperationContext.Current?.IncomingMessageProperties[RemoteEndpointMessageProperty.Name] as RemoteEndpointMessageProperty; - var httpInfo = OperationContext.Current?.IncomingMessageProperties[HttpRequestMessageProperty.Name] as HttpRequestMessageProperty; - - var basedir = AppDomain.CurrentDomain.BaseDirectory; - - var log = new - { - WindowsIdentity = new - { - winIdentity?.Name, - winIdentity?.IsAuthenticated, - winIdentity?.AuthenticationType - }, - ServiceSecurityContext = new - { - PrimaryIdentity = securityContext?.PrimaryIdentity?.Name, - WindowsIdentity = securityContext?.WindowsIdentity?.Name, - }, - Process = new - { - proc.ProcessName, - proc.StartTime - }, - AppDomain = new - { - AppDomain.CurrentDomain.BaseDirectory, - AppDomain.CurrentDomain.FriendlyName - }, - Environment = new - { - Environment.UserName, - Environment.MachineName, - Environment.OSVersion, - Environment.CurrentDirectory, - Environment.Is64BitProcess - }, - ThreadPrincipal = principal?.Identity?.Name, - IP = ipInfo?.Address, - Port = ipInfo?.Port, - UserAgent = httpInfo?.Headers["User-Agent"], - }; - - var str = JsonConvert.SerializeObject(log, Formatting.Indented); - File.WriteAllText(BeWoServerPathHelper.GetApiServiceTestFile(), str, Encoding.UTF8); + //generateApiServiceTestFile(); return ApiResponse.SuccessResponse("Hello World!"); } @@ -108,5 +59,59 @@ namespace BeWo.Service.ServiceImplementations return ApiResponse.SuccessResponse(sum ?? 0); } + + private void generateApiServiceTestFile() + { + var winIdentity = WindowsIdentity.GetCurrent(); + var securityContext = ServiceSecurityContext.Current; + var principal = Thread.CurrentPrincipal; + + var proc = Process.GetCurrentProcess(); + + var ipInfo = OperationContext.Current?.IncomingMessageProperties[RemoteEndpointMessageProperty.Name] as RemoteEndpointMessageProperty; + var httpInfo = OperationContext.Current?.IncomingMessageProperties[HttpRequestMessageProperty.Name] as HttpRequestMessageProperty; + + var basedir = AppDomain.CurrentDomain.BaseDirectory; + + var log = new + { + WindowsIdentity = new + { + winIdentity?.Name, + winIdentity?.IsAuthenticated, + winIdentity?.AuthenticationType + }, + ServiceSecurityContext = new + { + PrimaryIdentity = securityContext?.PrimaryIdentity?.Name, + WindowsIdentity = securityContext?.WindowsIdentity?.Name, + }, + Process = new + { + proc.ProcessName, + proc.StartTime + }, + AppDomain = new + { + AppDomain.CurrentDomain.BaseDirectory, + AppDomain.CurrentDomain.FriendlyName + }, + Environment = new + { + Environment.UserName, + Environment.MachineName, + Environment.OSVersion, + Environment.CurrentDirectory, + Environment.Is64BitProcess + }, + ThreadPrincipal = principal?.Identity?.Name, + IP = ipInfo?.Address, + Port = ipInfo?.Port, + UserAgent = httpInfo?.Headers["User-Agent"], + }; + + var str = JsonConvert.SerializeObject(log, Formatting.Indented); + File.WriteAllText(BeWoServerPathHelper.GetApiServiceTestFile(), str, Encoding.UTF8); + } } }