/// <summary>
        /// process request message in serialized form, and return the response message
        /// </summary>
        /// <param name="requestMessageString">request message in serialized form</param>
        /// <param name="uid">request message's uid</param>
        /// <returns>response message</returns>
        public virtual ResponseMessage ProcessString(string requestMessageString, long uid)
        {
            ResponseMessage responseMessage = null;
            var             requestMessage  = TranslationScope.Deserialize(requestMessageString, StringFormat.Xml);

            if (requestMessage is RequestMessage)
            {
                responseMessage = ProcessRequest((RequestMessage)requestMessage);
            }
            return(responseMessage);
        }
        public static Business.LoginResult TranslateFromServiceToBusiness(DataContracts.LoginResult serviceItem)
        {
            if (serviceItem == null)
            {
                return(null);
            }

            using (TranslationScope scope = new TranslationScope())
            {
                if (scope.Cache.Contains(serviceItem))
                {
                    return((Business.LoginResult)scope.Cache.Translate(serviceItem));
                }

                Business.LoginResult businessItem = new Business.LoginResult();
                scope.Cache.Add(serviceItem, businessItem);
                businessItem.Success      = serviceItem.Success;
                businessItem.ErrorMessage = serviceItem.ErrorMessage;
                return(businessItem);
            }
        }
        public static DataContracts.LoginResult TranslateFromBusinessToService(Business.LoginResult businessItem)
        {
            if (businessItem == null)
            {
                return(null);
            }

            using (TranslationScope scope = new TranslationScope())
            {
                if (scope.Cache.Contains(businessItem))
                {
                    return((DataContracts.LoginResult)scope.Cache.Translate(businessItem));
                }

                DataContracts.LoginResult serviceItem = new DataContracts.LoginResult();
                scope.Cache.Add(businessItem, serviceItem);

                serviceItem.Success      = businessItem.Success;
                serviceItem.ErrorMessage = businessItem.ErrorMessage;
                return(serviceItem);
            }
        }