public GetFacilitiesResponseDto RetrieveFacilitiesDesign(GetFacilitiesRequestDto request, HeaderArgs headerArgs)
        {
            GetFacilitiesResponseDto facilitiesConfiguration = null;
            try
            {
                var esbRequest = CreateRequest(request, headerArgs);
                var esbResponse = _serviceDesignInquiry.retrieveServiceDesign(esbRequest);
                facilitiesConfiguration = MapResponse(esbResponse);
            }
            catch (System.Exception e)
            {
                var isServiceException = _enterpriseExceptionHandler.HandleGeneralServiceExceptions(e);

                if (!isServiceException)
                {
                    if (_errorLoggingService != null)
                    {
                        _errorLoggingService.LogErrorNoContext(e);
                    }
                    throw;
                }
            }
            return facilitiesConfiguration;
        }
        public GetFacilitiesResponseDto RetrieveFacilitiesDesign(GetFacilitiesRequestDto request, HeaderArgs headerArgs)
        {
            GetFacilitiesResponseDto facilitiesDesign = null;
            try
            {
                var esbRequest = _getFacilitiesMappers.CreateGetFacilitiesRequest(request, headerArgs);
                var esbResponse = _rsdClient.invoke(esbRequest);
                facilitiesDesign = _getFacilitiesMappers.MapGetFacilitiesResponse(esbResponse);
            }
            catch (System.Exception e)
            {
                var isServiceException = _enterpriseExceptionHandler.HandleGeneralServiceExceptions(e);

                if (!isServiceException)
                {
                    if (_errorLoggingService != null)
                    {
                        _errorLoggingService.LogErrorNoContext(e);
                    }
                    throw;
                }
            }
            return facilitiesDesign;
        }
        private retrieveServiceDesignRequest CreateRequest(GetFacilitiesRequestDto request, HeaderArgs headerArgs)
        {
            //Null checked in caller
            var usi = request.USI;

            #region construct header
            var header = new Header
            {
                Source = "SIMPL",
                Security_T = new CharacteristicSpecification[2],
                ConsumerInfo = new CharacteristicSpecification[4]
            };

            header.Security_T[0] = new CharacteristicSpecification
            {
                name = "employeeID",
                Value = new CharacteristicValue
                {
                    value = headerArgs.CrisId
                }
            };

            header.Security_T[1] = new CharacteristicSpecification
            {
                name = "userID",
                Value = new CharacteristicValue
                {
                    value = headerArgs.CorpId ?? string.Empty
                }
            };

            header.ConsumerInfo[0] = new CharacteristicSpecification
            {
                name = "DPIEnvironment",
                Value = new CharacteristicValue
                {
                    value = headerArgs.DpiRegion ?? string.Empty
                }
            };

            header.ConsumerInfo[1] = new CharacteristicSpecification
            {
                name = "name",
                Value = new CharacteristicValue
                {
                    value = headerArgs.Name ?? string.Empty
                }
            };

            header.ConsumerInfo[2] = new CharacteristicSpecification
            {
                name = "email",
                Value = new CharacteristicValue
                {
                    value = headerArgs.Email ?? string.Empty
                }
            };

            header.ConsumerInfo[3] = new CharacteristicSpecification
            {
                name = "role",
                Value = new CharacteristicValue
                {
                    value = headerArgs.Role ?? string.Empty
                }
            };

            #endregion

            #region construct payload
            var searchCharacteristic = new CharacteristicSpecification[1];

            searchCharacteristic[0] = new CharacteristicSpecification
            {
                name = "uniqueServiceIdentifier",
                Value = new CharacteristicValue { value = usi }
            };

            var searchCriteria = new Entity[1];

            searchCriteria[0] = new Entity
            {
                type = "accountId",
                Characteristics = searchCharacteristic
            };

            var payload = new LookupRequest
            {
                SearchCriteria = searchCriteria
            };
            #endregion

            var esbRequest = new retrieveServiceDesignRequest
            {
                retrieveServiceDesign = new retrieveServiceDesign
                {
                    retrieveServiceDesignInput = new msg_LookupRequest
                    {
                        Header = header,
                        Payload = payload
                    }
                }
            };

            return esbRequest;
        }