예제 #1
0
        protected IAsyncResult BeginSendRequest(Message message, AsyncCallback callback, object state)
        {
            IAsyncResult result;

            base.AddRef();
            try
            {
                result = base.GetChannel(message).BeginRequest(message, callback, state);
            }
            catch (TimeoutException exception)
            {
                Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception, TraceEventType.Warning);
                base.OnChannelFailure();
                result = new SendMessageFailureAsyncResult(exception, callback, state);
            }
            catch (QuotaExceededException exception2)
            {
                Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception2, TraceEventType.Warning);
                base.OnChannelFailure();
                result = new SendMessageFailureAsyncResult(exception2, callback, state);
            }
            catch (FaultException exception3)
            {
                Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception3, TraceEventType.Warning);
                base.OnChannelFailure();
                result = new SendMessageFailureAsyncResult(exception3, callback, state);
            }
            catch (CommunicationException exception4)
            {
                Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception4, TraceEventType.Warning);
                base.OnChannelFailure();
                result = new SendMessageFailureAsyncResult(exception4, callback, state);
            }
            catch (Exception exception5)
            {
                DebugTrace.Trace(TraceLevel.Error, "Unhandled exception {0} in RequestReplyProxy.BeginSendRequest: {1}", exception5.GetType().Name, exception5);
                base.OnChannelFailure();
                throw Microsoft.Transactions.Bridge.DiagnosticUtility.InvokeFinalHandler(exception5);
            }
            return(result);
        }
예제 #2
0
 public void EndSendMessage(IAsyncResult ar)
 {
     try
     {
         SendMessageFailureAsyncResult result = ar as SendMessageFailureAsyncResult;
         if (result != null)
         {
             result.End();
         }
         else
         {
             base.GetChannel(null).EndSend(ar);
         }
     }
     catch (TimeoutException exception)
     {
         Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception, TraceEventType.Warning);
         throw Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new WsatSendFailureException(exception));
     }
     catch (QuotaExceededException exception2)
     {
         Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception2, TraceEventType.Warning);
         throw Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new WsatSendFailureException(exception2));
     }
     catch (CommunicationException exception3)
     {
         Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception3, TraceEventType.Warning);
         throw Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new WsatSendFailureException(exception3));
     }
     catch (Exception exception4)
     {
         DebugTrace.Trace(TraceLevel.Error, "Unhandled exception {0} in DatagramProxy.EndSendMessage: {1}", exception4.GetType().Name, exception4);
         Microsoft.Transactions.Bridge.DiagnosticUtility.InvokeFinalHandler(exception4);
     }
     finally
     {
         base.Release();
     }
 }
예제 #3
0
        public IAsyncResult BeginSendMessage(Message message, AsyncCallback callback, object state)
        {
            IAsyncResult result;

            if (base.from != null)
            {
                MessagingVersionHelper.SetReplyAddress(message, base.from, base.protocolVersion);
            }
            if (base.protocolVersion == ProtocolVersion.Version11)
            {
                message.Headers.ReplyTo = noneAddress;
            }
            base.AddRef();
            try
            {
                result = base.GetChannel(message).BeginSend(message, callback, state);
            }
            catch (TimeoutException exception)
            {
                Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception, TraceEventType.Warning);
                result = new SendMessageFailureAsyncResult(exception, callback, state);
            }
            catch (QuotaExceededException exception2)
            {
                Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception2, TraceEventType.Warning);
                result = new SendMessageFailureAsyncResult(exception2, callback, state);
            }
            catch (CommunicationException exception3)
            {
                Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception3, TraceEventType.Warning);
                result = new SendMessageFailureAsyncResult(exception3, callback, state);
            }
            catch (Exception exception4)
            {
                DebugTrace.Trace(TraceLevel.Error, "Unhandled exception {0} in DatagramProxy.BeginSendMessage: {1}", exception4.GetType().Name, exception4);
                throw Microsoft.Transactions.Bridge.DiagnosticUtility.InvokeFinalHandler(exception4);
            }
            return(result);
        }
예제 #4
0
        protected Message EndSendRequest(IAsyncResult ar, string replyAction)
        {
            Message message;

            try
            {
                SendMessageFailureAsyncResult result = ar as SendMessageFailureAsyncResult;
                if (result != null)
                {
                    result.End();
                    message = null;
                }
                else
                {
                    message = base.GetChannel(null).EndRequest(ar);
                }
            }
            catch (TimeoutException exception)
            {
                Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception, TraceEventType.Warning);
                base.OnChannelFailure();
                throw Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new WsatSendFailureException(exception));
            }
            catch (QuotaExceededException exception2)
            {
                Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception2, TraceEventType.Warning);
                base.OnChannelFailure();
                throw Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new WsatSendFailureException(exception2));
            }
            catch (FaultException exception3)
            {
                Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception3, TraceEventType.Warning);
                base.OnChannelFailure();
                throw Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new WsatFaultException(exception3.CreateMessageFault(), exception3.Action));
            }
            catch (CommunicationException exception4)
            {
                Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception4, TraceEventType.Warning);
                base.OnChannelFailure();
                throw Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new WsatSendFailureException(exception4));
            }
            catch (Exception exception5)
            {
                DebugTrace.Trace(TraceLevel.Error, "Unhandled exception {0} in RequestReplyProxy.ReadReply: {1}", exception5.GetType().Name, exception5);
                base.OnChannelFailure();
                throw Microsoft.Transactions.Bridge.DiagnosticUtility.InvokeFinalHandler(exception5);
            }
            finally
            {
                base.Release();
            }
            try
            {
                this.ValidateReply(message, replyAction);
            }
            catch
            {
                message.Close();
                throw;
            }
            return(message);
        }