Skip to content

Fox Biz Service Response

Fox Biz Service 는 비즈니스 로직 수행에 필요한 정보를 담는 FoxBizRequest 혹은 FoxBizRequestCollection 객체를 입력으로 받아 비즈 메서드를 수행하고 그 결과를 담는 FoxBizResponse 혹은 FoxBizResponseCollection 객체를 반환합니다. 이러한 응답 객체를 통해 호출자는 비즈 메서드 수행 결과, 오류 정보, 진단 정보 등 다양한 정보를 확인할 수 있습니다.

개발자가 직접 FoxBizResponse 와 FoxBizResponseCollection 객체를 생성하여 속성을 설정하는 등의 조작을 수행할 일은 거의 발생하지 않습니다. 대부분의 상황에서 개발자는 Fox Biz Service 가 반환하는 응답 객체를 그대로 사용하게 됩니다.

FoxBizResponse 객체

FoxBizResponse 객체는 Fox Biz Service 가 성공적으로 비즈 메서드를 수행하고 그 수행 결과를 반환하거나, 예외 전파 제어 기능을 통해 FoxBizRequest 객체의 ThrowException 속성이 false 로 지정된 경우, 오류 정보만을 포함하여 호출자에게 반환되는 객체 입니다.

기본 속성들

  • Success 속성

    비즈 메서드 호출의 성공 여부를 나타내는 값입니다. 비즈 메서드가 정상적으로 수행되면 true 값을 가집니다. FoxBizRequest.ThrowException 속성이 false 로 설정되었고 비즈 메서드 수행 중 오류가 발생하면 false 값을 가집니다.

    JSON 형태에서 Success 속성은 success 속성으로 표현됩니다.

    1
    2
    3
    {
        "success": true
    }
    

    Note

    FoxBizRequest.ThrowException 속성이 true 인 경우(디폴트 설정) FoxBizResponse 객체는 호출자에게 반환되지 않고 예외가 발생하여 전파됩니다.

  • Parameters 속성

    비즈 메서드가 출력 매개변수(output parameters)를 포함하는 경우, 그 결과를 담는 FoxServiceParameterCollection 타입의 컬렉션입니다. 기본적으로 키-값형태의 딕셔너리(IDictionary<string, object>)와 동일하게 접근할 수 있습니다.

    JSON 형태에서 Parameters 속성은 parameters 속성으로 표현됩니다.

    1
    2
    3
    4
    5
    6
    7
    {
        "success": true,
        "parameters": {
            "out_param1": "Value1",
            "out_param2": 2.34
        }
    }
    
  • Result 속성

    비즈 메서드가 반환하는 결과를 담는 속성입니다. 반환되는 결과는 비즈 메서드의 정의에 따라 단일 값, 컬렉션, 혹은 복합 객체 등 다양한 형태를 가질 수 있습니다.

    JSON 형태에서 Result 속성은 result 속성으로 표현됩니다.

    1
    2
    3
    4
    {
        "success": true,
        "result": "ECHO: Hello, World!"
    }
    
  • ErrorInfo 속성

    FoxBizRequest 객체의 ThrowException 속성이 false 로 설정된 경우, 비즈 메서드 수행 중 오류가 발생하면 예외를 발생시키지 않고 FoxBizResponse 객체 Success 속성 값이 false 로 설정되고 ErrorInfo 속성에 오류 정보가 담깁니다. 오류 정보는 FoxServiceErrorInfo 객체로서 예외 메시지, 예외 타입, 호출 스택 정보 등의 정보를 포함합니다.

    JSON 형태에서 ErrorInfo 속성은 errorInfo 속성으로 표현됩니다.

    1
    2
    3
    4
    5
    6
    7
    8
    {
        "success": false,
        "errorInfo": {
            "message": "An error occurred.",
            "exceptionType": "System.Exception",
            "stackTrace": "at ..."
        }
    }
    

진단 관련 속성들

  • ServerInfo 속성

    Fox Biz Service 서비스가 수행되는 서버에 대한 정보를 담고 있는 FoxServerInfo 타입의 속성입니다. 서버 호스트 이름, IP 주소 등의 정보를 포함합니다. 여러 서버에서 하나의 서비스를 수행하는 경우 구체적으로 어떤 서버가 서비스를 수행하고 결과를 반환했는지 확인할 수 있습니다.

    JSON 형태에서 ServerInfo 속성은 serverInfo 속성으로 표현됩니다.

    1
    2
    3
    4
    5
    6
    7
    {
        "success": true,
        "serverInfo": {
            "machineName": "ApiServer_1023",
            "ip": "10.2.215.214"
        }
    }
    

    Warning

    Fox Web API 를 통해 Fox Biz Service 를 호출한 경우, 서버 정보, 서비스 로그, 성능 정보 등을 반환 받기 위해서는 서비스 측의 FoxWebApiServerConfig.ReturnServerInfo 정적 속성을 true 로 설정하거나 구성 설정의 "webApiServer:returnServerInfo" 값을 true 로 설정해야 합니다.

    1
    2
    3
    4
    5
    {
        "webapiServer": {
            "returnServerInfo": true
        }
    }
    
  • Diagnostics 속성

    FoxBizResponse 객체에 포함된 진단정보를 나타내는 FoxBizResponseDiagnostics 열거 타입의 플래그 입니다. 예를 들어, 요청 시 로그 항목이 포함된 경우 이 속성은 HasServiceLog 플래그를 포함합니다. 이 속성에 포함될 수 있는 값들은 다음과 같습니다.

    • HasLogId: 유효한 로그 ID 가 LogId 속성에 포함되었습니다.
    • HasServiceLog : 서비스 로그가 ServiceLog 속성에 포함되었습니다.
    • HasPerformanceInfo : 성능 정보가 PerformanceInfo 속성에 포함되었습니다.

    JSON 형태에서 Diagnostics 속성은 diagnostics 속성으로 표현됩니다.

    1
    2
    3
    4
    {
        "success": true,
        "diagnostics": "HasLogId, HasServiceLog"
    }
    
  • LogId 속성

    FoxBizRequest.Diagnostics 속성에 LogId 플래그가 설정된 경우, Fox Biz Service 는 로그 ID 를 FoxBizResponse.LogId 속성에 기록하여 반환합니다. LogId 속성에 유효한 값이 포함된 경우 Diagnostics 속성에 HasLogId 플래그가 포함됩니다.

    JSON 형태에서 LogId 속성은 logId 속성으로 표현됩니다.

    1
    2
    3
    4
    5
    {
        "success": true,
        "diagnostics": "HasLogId",
        "logId": "00016:62696216"
    }
    
  • ServiceLog 속성

    FoxBizRequest.Diagnostics 속성에 ServiceLog 플래그가 설정된 경우, Fox Biz Service 는 서비스 로그를 FoxBizResponse.ServiceLog 속성에 기록하여 반환합니다. ServiceLog 속성에 유효한 값이 포함된 경우 Diagnostics 속성에 HasServiceLog 플래그가 포함됩니다.

    JSON 형태에서 ServiceLog 속성은 serviceLog 속성으로 표현됩니다.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    {
        "success": true,
        "diagnostics": "HasServiceLog",
        "serviceLog": [
            "I 2026-09-04 15:46:06.49551 [DataService] #00016:62696216#>> Data Service Start: ExecuteDataSet  Requests=1  UserId=  ClientMachine=  ClientIP=  ClientMAC=",
            "V 2026-09-04 15:46:06.49595 [DataService] #00016:62696216#    & EXPLICITLY Open Database Connection...",
            ......
        ]
    }
    
  • PerformanceInfo 속성

    FoxBizRequest.Diagnostics 속성에 PerformanceInfo 플래그가 설정된 경우, Fox Biz Service 는 성능 정보를 FoxBizResponse.PerformanceInfo 속성에 기록하여 반환합니다. PerformanceInfo 속성에 유효한 값이 포함된 경우 Diagnostics 속성에 HasPerformanceInfo 플래그가 포함됩니다.

    JSON 형태에서 PerformanceInfo 속성은 performanceInfo 속성으로 표현됩니다.

    {
        "success": true,
        "diagnostics": "HasPerformanceInfo",
        "performanceInfo": {
            "id": "4f53eb5f-5f39-41d3-8c4f-65a73dc4e6bb",
            "machineName": "NEOWORK2",
            "processId": 7364,
            ......
        }
    }
    

FoxBizResponseCollection 객체

FoxBizResponseCollection 객체는 Fox Biz Service 가 ExecuteMultiple 메서드를 호출한 결과로 반환하는 응답 컬렉션 객체입니다.

컬렉션 기본 속성들

  • 인덱서 속성

    FoxBizResponseCollection 객체는 IList<FoxBizResponse> 인터페이스를 구현하므로 인덱서를 통해 개별 FoxBizResponse 객체에 접근할 수 있습니다.

    1
    2
    3
    FoxBizResponseCollection responses = bizService.ExecuteMultiple(requests);
    FoxBizResponse firstResponse = responses[0];
    object result = firstResponse.Result;
    

    FoxBizResponseCollection 객체에 포함되는 FoxBizResponse 객체들의 개수는 ExecuteMultiple 메서드에 전달된 FoxBizRequestCollection 객체에 포함된 FoxBizRequest 객체들의 개수와 동일합니다. 다만 ExecuteMultiple 메서드 수행 중 모든 비즈 메서드 호출을 처리하기 전에 오류가 발생한 경우, 성공한 일부 비즈 메서드에 대한 FoxBizResponse 객체만 포함될 수 있습니다.

    FoxBizResponseCollection 객체는 다른 IList<T> 컬렉션과 같이 JSON 형태에서 items 속성의 배열로 표현됩니다.

    {
        "success": true,
        "items": [
            {
                "success": true,
                "affectedRows": 1
            },
            {
                "success": true,
                "scalarValue": 42
            }
        ]
    }
    
  • Success 속성

    Success 속성은 ExecuteMultiple 메서드 호출의 성공 여부를 나타냅니다.

    JSON 형태에서 Success 속성은 FoxBizResponse와 마찬가지로 success 속성으로 표현됩니다.

  • ErrorInfo 속성

    ErrorInfo 속성은 ExecuteMultiple 메서드 수행 중 발생한 예외 정보를 담고 있는 FoxServiceErrorInfo 객체를 반환합니다.

    ErrorInfo 속성이 오류(예외) 정보를 담는 상황은 FoxBizResponseCollection 객체의 ThrowException 속성이 false 이고 ExecuteMultiple 메서드 수행 중 오류가 발생하는 상황입니다.

    JSON 형태에서 ErrorInfo 속성은 FoxBizResponse 객체와 동일하게 errorInfo 속성으로 표현됩니다.

컬렉션 진단 관련 속성들

  • ServerInfo 속성

    Fox Biz Service 서비스가 수행되는 서버에 대한 정보를 담고 있는 FoxServerInfo 타입의 속성입니다. FoxBizResponseCollection 객체에 포함된 각 FoxBizResponse 객체의 ServerInfo 속성은 null 로 설정됩니다.

    FoxBizResponse 객체와 마찬가지로 JSON 형태에서 ServerInfo 속성은 serverInfo 속성으로 표현됩니다.

  • Diagnostics 속성

    FoxBizResponseCollection 객체에 포함된 진단정보를 나타내는 FoxBizResponseDiagnostics 열거 타입의 플래그 입니다.

    FoxBizResponse 객체와 마찬가지로 JSON 형태에서 Diagnostics 속성은 diagnostics 속성으로 표현됩니다.

  • LogId 속성

    FoxBizRequestCollection.Diagnostcis 속성에 LogId 플래그가 설정된 경우, Fox Biz Service 는 로그 ID 를 FoxBizResponseCollection.LogId 속성에 기록하여 반환합니다.

    FoxBizResponse 객체와 마찬가지로 JSON 형태에서 LogId 속성은 logId 속성으로 표현됩니다.

  • ServiceLog 속성

    FoxBizRequestCollection.Diagnostcis 속성에 ServiceLog 플래그가 설정된 경우, Fox Biz Service 는 서비스 로그를 FoxBizResponseCollection.ServiceLog 속성에 기록하여 반환합니다.

    FoxBizResponse 객체와 마찬가지로 JSON 형태에서 ServiceLog 속성은 serviceLog 속성으로 표현됩니다.

  • PerformanceInfo 속성

    FoxBizRequestCollection.Diagnostcis 속성에 PerformanceInfo 플래그가 설정된 경우, Fox Biz Service 는 성능 정보를 FoxBizResponseCollection.PerformanceInfo 속성에 기록하여 반환합니다.

    FoxBizResponse 객체와 마찬가지로 JSON 형태에서 PerformanceInfo 속성은 performanceInfo 속성으로 표현됩니다.

Summary

FoxBizResponse 객체와 FoxBizResponseCollection 객체는 Fox Biz Service 가 요청된 비즈 메서드를 수행하고 그 결과를 담고 있는 객체입니다. 이들 객체는 성공 여부, 비즈 메서드 수행 결과, 오류 정보, 진단 정보 등 다양한 정보를 포함하기 때문에 호출자는 이를 통해 비즈 메서드 수행 결과를 종합적으로 확인할 수 있습니다.