public SPDatabaseDetailsResponse GetDatabaseDetails(SPDatabaseDetailsRequest requestData)
        {
            if (requestData == null)
            {
                throw new ArgumentNullException(nameof(requestData));
            }
            if (mDatabaseDetails.ContainsKey(requestData.DatabaseId))
            {
                return(mDatabaseDetails[requestData.DatabaseId]);
            }

            RemoteMessageBinary request = new RemoteMessageBinary();

            request.CommunicationPattern = CommunicationPatternEnum.Request;
            request.MessageTypeCustomId  = string.Format("{0}_{1}", requestData.DatabaseId, GET_SP_DATABASE_DETAILS.ToString());
            request.Timeout = WaitTimeout;
            request.Data    = SerializeRequestData <SPDatabaseDetailsRequest>(requestData);

            RemoteMessageBase response = SendMessage(this, request);

            if (response is RemoteMessageBinary)
            {
                // deserialize response content
                RemoteMessageBinary       arrayResponse   = (RemoteMessageBinary)response;
                SPDatabaseDetailsResponse detailsResponse = DeserializeResponseData <SPDatabaseDetailsResponse>(arrayResponse);
                mDatabaseDetails[requestData.DatabaseId] = detailsResponse;
                return(detailsResponse);
            }
            else if (response is RemoteMessageError)
            {
                RemoteMessageError errorMessage = (RemoteMessageError)response;
                if (errorMessage.ErrorCode == (int)RemoteMessageErrorCodesEnum.Unknown_Message_Type)
                {
                    throw new ApplicationException("Unknown message. No backend configured for understand that message or it is offline.");
                }
                else
                {
                    throw errorMessage.GetException();
                }
            }
            else
            {
                throw new InvalidDataException();
            }
        }
        public DatabaseResponse GetDatabases()
        {
            if (mContainer != null)
            {
                return(mContainer);
            }

            RemoteMessageBinary request = new RemoteMessageBinary();

            request.CommunicationPattern = CommunicationPatternEnum.Request;
            request.MessageTypeCustomId  = GET_SP_DATABASES.ToString();
            request.Timeout = WaitTimeout;

            RemoteMessageBase response = SendMessage(this, request);

            if (response is RemoteMessageBinary)
            {
                // deserialize response content
                RemoteMessageBinary arrayResponse = (RemoteMessageBinary)response;
                return(mContainer = DeserializeResponseData <DatabaseResponse>(arrayResponse));
            }
            else if (response is RemoteMessageError)
            {
                RemoteMessageError errorMessage = (RemoteMessageError)response;
                if (errorMessage.ErrorCode == (int)RemoteMessageErrorCodesEnum.Unknown_Message_Type)
                {
                    throw new ApplicationException("Unknown message. No backend configured for understand that message or it is offline.");
                }
                else
                {
                    throw errorMessage.GetException();
                }
            }
            else
            {
                throw new InvalidDataException();
            }
        }