Exemple #1
0
        private MessageFault BuildFault(Exception error)
        {
            ServiceExceptionDetail exceptionDetail = new ServiceExceptionDetail(error);
            FaultCode code = FaultCode.CreateReceiverFaultCode(ServiceExceptionDetail.FaultSubCodeName, ServiceExceptionDetail.FaultSubCodeNamespace);

            return(MessageFault.CreateFault(code, new FaultReason(error.Message), exceptionDetail));
        }
Exemple #2
0
 public ServiceExceptionDetail(Exception ex)
     : base(ex)
 {
     this.AssemblyQualifiedName = ex.GetType().AssemblyQualifiedName;
     if (null != ex.InnerException)
     {
         this.InnerException = new ServiceExceptionDetail(ex.InnerException);
     }
 }
        private static Exception GetException(ServiceExceptionDetail exceptionDetail)
        {
            Type exceptionType = Type.GetType(exceptionDetail.AssemblyQualifiedName);

            if (null == exceptionDetail.InnerException)
            {
                return((Exception)Activator.CreateInstance(exceptionType, exceptionDetail.Message));
            }
            Exception innerException = GetException(exceptionDetail.InnerException);

            return((Exception)Activator.CreateInstance(exceptionType, exceptionDetail.Message, innerException));
        }
 private MessageFault BuildFault(Exception error)
 {
     ServiceExceptionDetail exceptionDetail = new ServiceExceptionDetail(error);
     FaultCode code = FaultCode.CreateReceiverFaultCode(ServiceExceptionDetail.FaultSubCodeName,ServiceExceptionDetail.FaultSubCodeNamespace);
     return MessageFault.CreateFault(code, new FaultReason(error.Message),exceptionDetail);
 }