public static bool ReadFrom(Message message, out Guid enlistmentId, out ControlProtocol protocol)
 {
     int num;
     enlistmentId = Guid.Empty;
     protocol = ControlProtocol.None;
     try
     {
         num = message.Headers.FindHeader("Enlistment", "http://schemas.microsoft.com/ws/2006/02/transactions", new string[] { string.Empty });
     }
     catch (MessageHeaderException exception)
     {
         Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception, TraceEventType.Warning);
         return false;
     }
     if (num < 0)
     {
         return false;
     }
     XmlDictionaryReader readerAtHeader = message.Headers.GetReaderAtHeader(num);
     using (readerAtHeader)
     {
         ReadFrom(readerAtHeader, out enlistmentId, out protocol);
     }
     MessageHeaderInfo headerInfo = message.Headers[num];
     if (!message.Headers.UnderstoodHeaders.Contains(headerInfo))
     {
         message.Headers.UnderstoodHeaders.Add(headerInfo);
     }
     return true;
 }
コード例 #2
0
        private void OnSendRegisterComplete(CoordinatorEnlistment coordinator, ControlProtocol protocol, IAsyncResult ar)
        {
            SynchronizationEvent event2;
            EndpointAddress      to = null;

            try
            {
                RegisterResponse response = coordinator.RegistrationProxy.EndSendRegister(ar);
                to = response.CoordinatorProtocolService;
                TwoPhaseCommitCoordinatorProxy proxy = this.state.TryCreateTwoPhaseCommitCoordinatorProxy(to);
                if (proxy == null)
                {
                    if (RegistrationCoordinatorResponseInvalidMetadataRecord.ShouldTrace)
                    {
                        RegistrationCoordinatorResponseInvalidMetadataRecord.Trace(coordinator.EnlistmentId, coordinator.SuperiorContext, protocol, to, null, this.state.ProtocolVersion);
                    }
                    event2 = new MsgRegistrationCoordinatorSendFailureEvent(coordinator);
                }
                else
                {
                    try
                    {
                        if (protocol == ControlProtocol.Durable2PC)
                        {
                            event2 = new MsgRegisterDurableResponseEvent(coordinator, response, proxy);
                        }
                        else
                        {
                            VolatileCoordinatorEnlistment asyncState = (VolatileCoordinatorEnlistment)ar.AsyncState;
                            event2 = new MsgRegisterVolatileResponseEvent(asyncState, response, proxy);
                        }
                    }
                    finally
                    {
                        proxy.Release();
                    }
                }
            }
            catch (WsatFaultException exception)
            {
                Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception, TraceEventType.Warning);
                event2 = new MsgRegistrationCoordinatorFaultEvent(coordinator, protocol, exception.Fault);
                if (RegistrationCoordinatorFaultedRecord.ShouldTrace)
                {
                    RegistrationCoordinatorFaultedRecord.Trace(coordinator.EnlistmentId, coordinator.SuperiorContext, protocol, exception.Fault);
                }
            }
            catch (WsatMessagingException exception2)
            {
                Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception2, TraceEventType.Warning);
                this.state.Perf.MessageSendFailureCountPerInterval.Increment();
                if (RegistrationCoordinatorFailedRecord.ShouldTrace)
                {
                    RegistrationCoordinatorFailedRecord.Trace(coordinator.EnlistmentId, coordinator.SuperiorContext, protocol, exception2);
                }
                DebugTrace.TraceSendFailure(coordinator.EnlistmentId, exception2);
                event2 = new MsgRegistrationCoordinatorSendFailureEvent(coordinator);
            }
            coordinator.StateMachine.Enqueue(event2);
        }
コード例 #3
0
        public static bool ReadFrom(Message message, out Guid enlistmentId, out ControlProtocol protocol)
        {
            int num;

            enlistmentId = Guid.Empty;
            protocol     = ControlProtocol.None;
            try
            {
                num = message.Headers.FindHeader("Enlistment", "http://schemas.microsoft.com/ws/2006/02/transactions", new string[] { string.Empty });
            }
            catch (MessageHeaderException exception)
            {
                Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception, TraceEventType.Warning);
                return(false);
            }
            if (num < 0)
            {
                return(false);
            }
            XmlDictionaryReader readerAtHeader = message.Headers.GetReaderAtHeader(num);

            using (readerAtHeader)
            {
                ReadFrom(readerAtHeader, out enlistmentId, out protocol);
            }
            MessageHeaderInfo headerInfo = message.Headers[num];

            if (!message.Headers.UnderstoodHeaders.Contains(headerInfo))
            {
                message.Headers.UnderstoodHeaders.Add(headerInfo);
            }
            return(true);
        }
コード例 #4
0
 private void ReadFrom(XmlDictionaryReader reader)
 {
     try
     {
         reader.ReadFullStartElement(this.coordinationXmlDictionaryStrings.Register, this.coordinationXmlDictionaryStrings.Namespace);
         reader.MoveToStartElement(this.coordinationXmlDictionaryStrings.Protocol, this.coordinationXmlDictionaryStrings.Namespace);
         this.Protocol = WSAtomicTransactionStrings.WellKnownNameToProtocol(reader.ReadElementContentAsString().Trim(), this.protocolVersion);
         if (this.Protocol == ControlProtocol.None)
         {
             throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidMessageException(Microsoft.Transactions.SR.GetString("InvalidMessageBody")));
         }
         this.ParticipantProtocolService = EndpointAddress.ReadFrom(MessagingVersionHelper.AddressingVersion(this.protocolVersion), reader, this.coordinationXmlDictionaryStrings.ParticipantProtocolService, this.coordinationXmlDictionaryStrings.Namespace);
         if (reader.IsStartElement(XD.DotNetAtomicTransactionExternalDictionary.Loopback, XD.DotNetAtomicTransactionExternalDictionary.Namespace))
         {
             this.Loopback = reader.ReadElementContentAsGuid();
         }
         while (reader.IsStartElement())
         {
             reader.Skip();
         }
         reader.ReadEndElement();
     }
     catch (XmlException exception)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidMessageException(Microsoft.Transactions.SR.GetString("InvalidMessageBody"), exception));
     }
 }
 private void OnSendRegisterComplete(CoordinatorEnlistment coordinator, ControlProtocol protocol, IAsyncResult ar)
 {
     SynchronizationEvent event2;
     EndpointAddress to = null;
     try
     {
         RegisterResponse response = coordinator.RegistrationProxy.EndSendRegister(ar);
         to = response.CoordinatorProtocolService;
         TwoPhaseCommitCoordinatorProxy proxy = this.state.TryCreateTwoPhaseCommitCoordinatorProxy(to);
         if (proxy == null)
         {
             if (RegistrationCoordinatorResponseInvalidMetadataRecord.ShouldTrace)
             {
                 RegistrationCoordinatorResponseInvalidMetadataRecord.Trace(coordinator.EnlistmentId, coordinator.SuperiorContext, protocol, to, null, this.state.ProtocolVersion);
             }
             event2 = new MsgRegistrationCoordinatorSendFailureEvent(coordinator);
         }
         else
         {
             try
             {
                 if (protocol == ControlProtocol.Durable2PC)
                 {
                     event2 = new MsgRegisterDurableResponseEvent(coordinator, response, proxy);
                 }
                 else
                 {
                     VolatileCoordinatorEnlistment asyncState = (VolatileCoordinatorEnlistment) ar.AsyncState;
                     event2 = new MsgRegisterVolatileResponseEvent(asyncState, response, proxy);
                 }
             }
             finally
             {
                 proxy.Release();
             }
         }
     }
     catch (WsatFaultException exception)
     {
         Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception, TraceEventType.Warning);
         event2 = new MsgRegistrationCoordinatorFaultEvent(coordinator, protocol, exception.Fault);
         if (RegistrationCoordinatorFaultedRecord.ShouldTrace)
         {
             RegistrationCoordinatorFaultedRecord.Trace(coordinator.EnlistmentId, coordinator.SuperiorContext, protocol, exception.Fault);
         }
     }
     catch (WsatMessagingException exception2)
     {
         Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception2, TraceEventType.Warning);
         this.state.Perf.MessageSendFailureCountPerInterval.Increment();
         if (RegistrationCoordinatorFailedRecord.ShouldTrace)
         {
             RegistrationCoordinatorFailedRecord.Trace(coordinator.EnlistmentId, coordinator.SuperiorContext, protocol, exception2);
         }
         DebugTrace.TraceSendFailure(coordinator.EnlistmentId, exception2);
         event2 = new MsgRegistrationCoordinatorSendFailureEvent(coordinator);
     }
     coordinator.StateMachine.Enqueue(event2);
 }
 public RegisterCoordinatorRecordSchema11(CoordinationContext context, ControlProtocol protocol, EndpointAddress coordinatorService) : base(context, protocol)
 {
     base.schemaId = "http://schemas.microsoft.com/2006/08/ServiceModel/RegisterCoordinator11TraceRecord";
     if (coordinatorService != null)
     {
         this.coordinatorService = EndpointAddress10.FromEndpointAddress(coordinatorService);
     }
 }
 public RegisterCoordinatorRecordSchema10(CoordinationContext context, ControlProtocol protocol, EndpointAddress coordinatorService) : base(context, protocol)
 {
     base.schemaId = "http://schemas.microsoft.com/2006/08/ServiceModel/RegisterCoordinatorTraceRecord";
     if (coordinatorService != null)
     {
         this.coordinatorService = EndpointAddressAugust2004.FromEndpointAddress(coordinatorService);
     }
 }
コード例 #8
0
 public RegisterFailureRecordSchema11(string transactionId, ControlProtocol protocol, EndpointAddress protocolService, string reason) : base(transactionId, protocol, reason)
 {
     base.schemaId = "http://schemas.microsoft.com/2006/08/ServiceModel/RegisterFailure11TraceRecord";
     if (protocolService != null)
     {
         this.protocolService = EndpointAddress10.FromEndpointAddress(protocolService);
     }
 }
 public RegisterParticipantRecordSchema11(string transactionId, Guid enlistmentId, ControlProtocol protocol, EndpointAddress participantService) : base(transactionId, enlistmentId, protocol)
 {
     base.schemaId = "http://schemas.microsoft.com/2006/08/ServiceModel/RegisterParticipant11TraceRecord";
     if (participantService != null)
     {
         this.participantService = EndpointAddress10.FromEndpointAddress(participantService);
     }
 }
 public RegistrationCoordinatorResponseInvalidMetadataSchema11(CoordinationContext context, ControlProtocol protocol, EndpointAddress coordinatorService) : base(context, protocol)
 {
     base.schemaId = "http://schemas.microsoft.com/2006/08/ServiceModel/RegistrationCoordinatorResponseInvalidMetadata11TraceRecord";
     if (coordinatorService != null)
     {
         this.coordinatorService = EndpointAddress10.FromEndpointAddress(coordinatorService);
     }
 }
コード例 #11
0
 public Register(Microsoft.Transactions.Wsat.Protocol.ProtocolVersion protocolVersion)
 {
     this.Protocol = ControlProtocol.None;
     this.ParticipantProtocolService = null;
     this.Loopback = Guid.Empty;
     this.SupportingToken = null;
     this.protocolVersion = protocolVersion;
     this.coordinationStrings = CoordinationStrings.Version(protocolVersion);
     this.coordinationXmlDictionaryStrings = CoordinationXmlDictionaryStrings.Version(protocolVersion);
 }
コード例 #12
0
 public Register(Microsoft.Transactions.Wsat.Protocol.ProtocolVersion protocolVersion)
 {
     this.Protocol = ControlProtocol.None;
     this.ParticipantProtocolService = null;
     this.Loopback            = Guid.Empty;
     this.SupportingToken     = null;
     this.protocolVersion     = protocolVersion;
     this.coordinationStrings = CoordinationStrings.Version(protocolVersion);
     this.coordinationXmlDictionaryStrings = CoordinationXmlDictionaryStrings.Version(protocolVersion);
 }
        public static RegisterParticipantRecordSchema Instance(string transactionId, Guid enlistmentId, ControlProtocol protocol, EndpointAddress participantService, ProtocolVersion protocolVersion)
        {
            ProtocolVersionHelper.AssertProtocolVersion(protocolVersion, typeof(RegisterParticipantRecordSchema), "Instance");
            switch (protocolVersion)
            {
                case ProtocolVersion.Version10:
                    return new RegisterParticipantRecordSchema10(transactionId, enlistmentId, protocol, participantService);

                case ProtocolVersion.Version11:
                    return new RegisterParticipantRecordSchema11(transactionId, enlistmentId, protocol, participantService);
            }
            return null;
        }
        public static RegisterFailureRecordSchema Instance(string transactionId, ControlProtocol protocol, EndpointAddress protocolService, string reason, ProtocolVersion protocolVersion)
        {
            ProtocolVersionHelper.AssertProtocolVersion(protocolVersion, typeof(RegisterFailureRecordSchema), "Instance");
            switch (protocolVersion)
            {
            case ProtocolVersion.Version10:
                return(new RegisterFailureRecordSchema10(transactionId, protocol, protocolService, reason));

            case ProtocolVersion.Version11:
                return(new RegisterFailureRecordSchema11(transactionId, protocol, protocolService, reason));
            }
            return(null);
        }
        public static RegisterCoordinatorRecordSchema Instance(CoordinationContext context, ControlProtocol protocol, EndpointAddress coordinatorService, ProtocolVersion protocolVersion)
        {
            ProtocolVersionHelper.AssertProtocolVersion(protocolVersion, typeof(RegisterCoordinatorRecordSchema), "Instance");
            switch (protocolVersion)
            {
                case ProtocolVersion.Version10:
                    return new RegisterCoordinatorRecordSchema10(context, protocol, coordinatorService);

                case ProtocolVersion.Version11:
                    return new RegisterCoordinatorRecordSchema11(context, protocol, coordinatorService);
            }
            return null;
        }
コード例 #16
0
        /// <summary> 处理收到的控制信息
        /// </summary>
        /// <param name="state"></param>
        private static void SaveData(object state)
        {
            if (state is ControlProtocol)
            {
                ControlProtocol protocol = state as ControlProtocol;
                bool            result   = false;
                //保存至数据库,并返回成功/失败信息
                Dictionary <string, string> dicFileds = new Dictionary <string, string>();
                if (protocol.SubMessageId == SubMessageId3)
                {
                    result = DBHelper.Submit_AddOrEdit("更新有效期信息", "HXC_000", "tb_signing_info", "sign_id", GlobalStaticObj_Server.Instance.StationID, new Dictionary <string, string> {
                        { "protocol_expires_time", protocol.Date }
                    });
                }
                else
                {
                    if (protocol.ControlType.Equals(DataSources.EnumControlType.UnAvailble.ToString("d")))
                    {
                        dicFileds.Add("status", DataSources.EnumStatus.Stop.ToString("d"));
                    }
                    else if (protocol.ControlType.Equals(DataSources.EnumControlType.Availble.ToString("d")))
                    {
                        dicFileds.Add("status", DataSources.EnumStatus.Start.ToString("d"));
                    }

                    if (dicFileds.Count > 0)
                    {
                        //协议里包含帐套信息
                        result = DBHelper.Submit_AddOrEdit("修改用户信息", GlobalStaticObj_Server.Instance.CurrAccDbName, "sys_user", "user_id", "", dicFileds);
                    }
                }
                ResultProtocol rp = new ResultProtocol();
                rp.StationId        = protocol.StationId;
                rp.SerialNumber     = protocol.SerialNumber;
                rp.MessageId        = protocol.MessageId;
                rp.SubMessageId     = protocol.SubMessageId;
                rp.TimeSpan         = protocol.TimeSpan;
                rp.SerialNumberLock = true;
                if (result)
                {
                    rp.Result = DataSources.EnumResultType.Success.ToString("d");
                }
                else
                {
                    rp.Result = DataSources.EnumResultType.Fail.ToString("d");
                }
                ServiceAgent.AddSendQueue(rp);
            }
        }
        public static XmlDictionaryString ProtocolToWellKnownName(ControlProtocol ctrlProt, ProtocolVersion protocolVersion)
        {
            AtomicTransactionXmlDictionaryStrings strings = AtomicTransactionXmlDictionaryStrings.Version(protocolVersion);
            switch (ctrlProt)
            {
                case ControlProtocol.Completion:
                    return strings.CompletionUri;

                case ControlProtocol.Volatile2PC:
                    return strings.Volatile2PCUri;

                case ControlProtocol.Durable2PC:
                    return strings.Durable2PCUri;
            }
            DiagnosticUtility.FailFast("Invalid protocol");
            return null;
        }
コード例 #18
0
        public static XmlDictionaryString ProtocolToWellKnownName(ControlProtocol ctrlProt, ProtocolVersion protocolVersion)
        {
            AtomicTransactionXmlDictionaryStrings strings = AtomicTransactionXmlDictionaryStrings.Version(protocolVersion);

            switch (ctrlProt)
            {
            case ControlProtocol.Completion:
                return(strings.CompletionUri);

            case ControlProtocol.Volatile2PC:
                return(strings.Volatile2PCUri);

            case ControlProtocol.Durable2PC:
                return(strings.Durable2PCUri);
            }
            DiagnosticUtility.FailFast("Invalid protocol");
            return(null);
        }
コード例 #19
0
 public static bool TryGetEnlistment(Message message, out Guid enlistmentId, out ControlProtocol protocol)
 {
     enlistmentId = Guid.Empty;
     protocol     = ControlProtocol.None;
     try
     {
         if (!EnlistmentHeader.ReadFrom(message, out enlistmentId, out protocol))
         {
             return(false);
         }
     }
     catch (InvalidEnlistmentHeaderException exception)
     {
         Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception, TraceEventType.Warning);
         return(false);
     }
     return(true);
 }
コード例 #20
0
 public static bool TryGetEnlistment(Message message, out Guid enlistmentId, out ControlProtocol protocol)
 {
     enlistmentId = Guid.Empty;
     protocol = ControlProtocol.None;
     try
     {
         if (!EnlistmentHeader.ReadFrom(message, out enlistmentId, out protocol))
         {
             return false;
         }
     }
     catch (InvalidEnlistmentHeaderException exception)
     {
         Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception, TraceEventType.Warning);
         return false;
     }
     return true;
 }
コード例 #21
0
        private void SendRegister(CoordinatorEnlistment coordinator, ControlProtocol protocol, EndpointAddress protocolService, AsyncCallback callback, object callbackState)
        {
            Register register = new Register(this.state.ProtocolVersion)
            {
                Protocol = protocol,
                Loopback = this.state.ProcessId,
                ParticipantProtocolService = protocolService,
                SupportingToken            = coordinator.SuperiorIssuedToken
            };

            if (DebugTrace.Info)
            {
                DebugTrace.TxTrace(TraceLevel.Info, coordinator.EnlistmentId, "Sending Register for {0} to {1}", protocol, Ports.TryGetAddress(coordinator.RegistrationProxy));
            }
            IAsyncResult ar = coordinator.RegistrationProxy.BeginSendRegister(ref register, callback, callbackState);

            if (ar.CompletedSynchronously)
            {
                this.OnSendRegisterComplete(coordinator, protocol, ar);
            }
        }
コード例 #22
0
 public static void ReadFrom(XmlDictionaryReader reader, out Guid enlistment, out ControlProtocol protocol)
 {
     try
     {
         if (reader.IsEmptyElement || !reader.IsStartElement(XD.DotNetAtomicTransactionExternalDictionary.Enlistment, XD.DotNetAtomicTransactionExternalDictionary.Namespace))
         {
             throw Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidEnlistmentHeaderException(Microsoft.Transactions.SR.GetString("InvalidEnlistmentHeader")));
         }
         string attribute = reader.GetAttribute(XD.DotNetAtomicTransactionExternalDictionary.Protocol, XD.DotNetAtomicTransactionExternalDictionary.Namespace);
         if (attribute == null)
         {
             protocol = ControlProtocol.None;
         }
         else
         {
             protocol = (ControlProtocol)XmlConvert.ToInt32(attribute.Trim());
             if ((protocol != ControlProtocol.Durable2PC) && (protocol != ControlProtocol.Volatile2PC))
             {
                 throw Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidEnlistmentHeaderException(Microsoft.Transactions.SR.GetString("InvalidEnlistmentHeader")));
             }
         }
         enlistment = reader.ReadElementContentAsGuid();
     }
     catch (FormatException exception)
     {
         Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception, TraceEventType.Warning);
         throw Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidEnlistmentHeaderException(Microsoft.Transactions.SR.GetString("InvalidEnlistmentHeader"), exception));
     }
     catch (OverflowException exception2)
     {
         Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception2, TraceEventType.Warning);
         throw Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidEnlistmentHeaderException(Microsoft.Transactions.SR.GetString("InvalidEnlistmentHeader"), exception2));
     }
     catch (XmlException exception3)
     {
         Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception3, TraceEventType.Warning);
         throw Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidEnlistmentHeaderException(Microsoft.Transactions.SR.GetString("InvalidEnlistmentHeader"), exception3));
     }
 }
 public static void ReadFrom(XmlDictionaryReader reader, out Guid enlistment, out ControlProtocol protocol)
 {
     try
     {
         if (reader.IsEmptyElement || !reader.IsStartElement(XD.DotNetAtomicTransactionExternalDictionary.Enlistment, XD.DotNetAtomicTransactionExternalDictionary.Namespace))
         {
             throw Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidEnlistmentHeaderException(Microsoft.Transactions.SR.GetString("InvalidEnlistmentHeader")));
         }
         string attribute = reader.GetAttribute(XD.DotNetAtomicTransactionExternalDictionary.Protocol, XD.DotNetAtomicTransactionExternalDictionary.Namespace);
         if (attribute == null)
         {
             protocol = ControlProtocol.None;
         }
         else
         {
             protocol = (ControlProtocol) XmlConvert.ToInt32(attribute.Trim());
             if ((protocol != ControlProtocol.Durable2PC) && (protocol != ControlProtocol.Volatile2PC))
             {
                 throw Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidEnlistmentHeaderException(Microsoft.Transactions.SR.GetString("InvalidEnlistmentHeader")));
             }
         }
         enlistment = reader.ReadElementContentAsGuid();
     }
     catch (FormatException exception)
     {
         Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception, TraceEventType.Warning);
         throw Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidEnlistmentHeaderException(Microsoft.Transactions.SR.GetString("InvalidEnlistmentHeader"), exception));
     }
     catch (OverflowException exception2)
     {
         Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception2, TraceEventType.Warning);
         throw Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidEnlistmentHeaderException(Microsoft.Transactions.SR.GetString("InvalidEnlistmentHeader"), exception2));
     }
     catch (XmlException exception3)
     {
         Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception3, TraceEventType.Warning);
         throw Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidEnlistmentHeaderException(Microsoft.Transactions.SR.GetString("InvalidEnlistmentHeader"), exception3));
     }
 }
 public MsgRegistrationCoordinatorFaultEvent(CoordinatorEnlistment coordinator, ControlProtocol protocol, MessageFault fault) : base(coordinator, fault)
 {
     this.protocol = protocol;
 }
 public static void Trace(Guid enlistmentId, string transactionId, ControlProtocol protocol, EndpointAddress participantService, ProtocolVersion protocolVersion)
 {
     RegisterParticipantRecordSchema extendedData = RegisterParticipantRecordSchema.Instance(transactionId, enlistmentId, protocol, participantService, protocolVersion);
     TxTraceUtility.Trace(TraceEventType.Information, GetCode(protocolVersion), Microsoft.Transactions.SR.GetString("RegisterParticipant"), extendedData, null, enlistmentId, null);
 }
 public static void Trace(Guid enlistmentId, CoordinationContext context, ControlProtocol protocol, EndpointAddress coordinatorService, Exception e, ProtocolVersion protocolVersion)
 {
     RegistrationCoordinatorResponseInvalidMetadataSchema extendedData = RegistrationCoordinatorResponseInvalidMetadataSchema.Instance(context, protocol, coordinatorService, protocolVersion);
     TxTraceUtility.Trace(TraceEventType.Warning, GetCode(protocolVersion), Microsoft.Transactions.SR.GetString("RegistrationCoordinatorResponseInvalidMetadata"), extendedData, e, enlistmentId, null);
 }
コード例 #27
0
 public EnlistmentHeader(Guid enlistment, ControlProtocol protocol)
 {
     this.enlistment = enlistment;
     this.protocol   = protocol;
 }
 public RegisterParticipantRecordSchema10(string transactionId, Guid enlistmentId, ControlProtocol protocol, EndpointAddress participantService) : base(transactionId, enlistmentId, protocol)
 {
     base.schemaId = "http://schemas.microsoft.com/2006/08/ServiceModel/RegisterParticipantTraceRecord";
     if (participantService != null)
     {
         this.participantService = EndpointAddressAugust2004.FromEndpointAddress(participantService);
     }
 }
コード例 #29
0
        public static RegisterParticipantRecordSchema Instance(string transactionId, Guid enlistmentId, ControlProtocol protocol, EndpointAddress participantService, ProtocolVersion protocolVersion)
        {
            ProtocolVersionHelper.AssertProtocolVersion(protocolVersion, typeof(RegisterParticipantRecordSchema), "Instance");
            switch (protocolVersion)
            {
            case ProtocolVersion.Version10:
                return(new RegisterParticipantRecordSchema10(transactionId, enlistmentId, protocol, participantService));

            case ProtocolVersion.Version11:
                return(new RegisterParticipantRecordSchema11(transactionId, enlistmentId, protocol, participantService));
            }
            return(null);
        }
 protected RegistrationCoordinatorResponseInvalidMetadataSchema(CoordinationContext context, ControlProtocol protocol)
 {
     this.context  = context;
     this.protocol = protocol;
 }
コード例 #31
0
 public RegistrationCoordinatorFaultedSchema(CoordinationContext context, ControlProtocol protocol, MessageFault fault)
 {
     this.context  = context;
     this.protocol = protocol;
     this.fault    = fault;
 }
 protected RegisterCoordinatorRecordSchema(CoordinationContext context, ControlProtocol protocol)
 {
     this.context = context;
     this.protocol = protocol;
 }
 protected RegisterFailureRecordSchema(string transactionId, ControlProtocol protocol, string reason)
 {
     this.transactionId = transactionId;
     this.protocol      = protocol;
     this.reason        = reason;
 }
コード例 #34
0
        public void SendRegisterResponse(Microsoft.Transactions.Wsat.Protocol.TransactionEnlistment enlistment, Microsoft.Transactions.Wsat.Messaging.RequestAsyncResult result, ControlProtocol protocol, EndpointAddress coordinatorService)
        {
            RegisterResponse response = new RegisterResponse(this.state.ProtocolVersion)
            {
                CoordinatorProtocolService = coordinatorService
            };

            if (DebugTrace.Info)
            {
                DebugTrace.TxTrace(TraceLevel.Info, enlistment.EnlistmentId, "Sending RegisterResponse for {0}", protocol);
            }
            RegistrationProxy.SendRegisterResponse(result, ref response);
        }
 protected RegisterParticipantRecordSchema(string transactionId, Guid enlistmentId, ControlProtocol protocol)
 {
     this.transactionId = transactionId;
     this.enlistmentId = enlistmentId;
     this.protocol = protocol;
 }
        public static RegistrationCoordinatorResponseInvalidMetadataSchema Instance(CoordinationContext context, ControlProtocol protocol, EndpointAddress coordinatorService, ProtocolVersion protocolVersion)
        {
            ProtocolVersionHelper.AssertProtocolVersion(protocolVersion, typeof(RegistrationCoordinatorResponseInvalidMetadataSchema), "Instance");
            switch (protocolVersion)
            {
            case ProtocolVersion.Version10:
                return(new RegistrationCoordinatorResponseInvalidMetadataSchema10(context, protocol, coordinatorService));

            case ProtocolVersion.Version11:
                return(new RegistrationCoordinatorResponseInvalidMetadataSchema11(context, protocol, coordinatorService));
            }
            return(null);
        }
 public EnlistmentHeader(Guid enlistment, ControlProtocol protocol)
 {
     this.enlistment = enlistment;
     this.protocol = protocol;
 }
 protected RegistrationCoordinatorResponseInvalidMetadataSchema(CoordinationContext context, ControlProtocol protocol)
 {
     this.context = context;
     this.protocol = protocol;
 }
コード例 #39
0
 private void ReadFrom(XmlDictionaryReader reader)
 {
     try
     {
         reader.ReadFullStartElement(this.coordinationXmlDictionaryStrings.Register, this.coordinationXmlDictionaryStrings.Namespace);
         reader.MoveToStartElement(this.coordinationXmlDictionaryStrings.Protocol, this.coordinationXmlDictionaryStrings.Namespace);
         this.Protocol = WSAtomicTransactionStrings.WellKnownNameToProtocol(reader.ReadElementContentAsString().Trim(), this.protocolVersion);
         if (this.Protocol == ControlProtocol.None)
         {
             throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidMessageException(Microsoft.Transactions.SR.GetString("InvalidMessageBody")));
         }
         this.ParticipantProtocolService = EndpointAddress.ReadFrom(MessagingVersionHelper.AddressingVersion(this.protocolVersion), reader, this.coordinationXmlDictionaryStrings.ParticipantProtocolService, this.coordinationXmlDictionaryStrings.Namespace);
         if (reader.IsStartElement(XD.DotNetAtomicTransactionExternalDictionary.Loopback, XD.DotNetAtomicTransactionExternalDictionary.Namespace))
         {
             this.Loopback = reader.ReadElementContentAsGuid();
         }
         while (reader.IsStartElement())
         {
             reader.Skip();
         }
         reader.ReadEndElement();
     }
     catch (XmlException exception)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidMessageException(Microsoft.Transactions.SR.GetString("InvalidMessageBody"), exception));
     }
 }
        public static void Trace(Guid enlistmentId, CoordinationContext context, ControlProtocol protocol, MessageFault fault)
        {
            RegistrationCoordinatorFaultedSchema extendedData = new RegistrationCoordinatorFaultedSchema(context, protocol, fault);

            TxTraceUtility.Trace(TraceEventType.Warning, 0xb0006, Microsoft.Transactions.SR.GetString("RegistrationCoordinatorFaulted"), extendedData, null, enlistmentId, null);
        }
        public static void Trace(Guid enlistmentId, CoordinationContext context, ControlProtocol protocol, EndpointAddress coordinatorService, Exception e, ProtocolVersion protocolVersion)
        {
            RegistrationCoordinatorResponseInvalidMetadataSchema extendedData = RegistrationCoordinatorResponseInvalidMetadataSchema.Instance(context, protocol, coordinatorService, protocolVersion);

            TxTraceUtility.Trace(TraceEventType.Warning, GetCode(protocolVersion), Microsoft.Transactions.SR.GetString("RegistrationCoordinatorResponseInvalidMetadata"), extendedData, e, enlistmentId, null);
        }
 private void SendRegister(CoordinatorEnlistment coordinator, ControlProtocol protocol, EndpointAddress protocolService, AsyncCallback callback, object callbackState)
 {
     Register register = new Register(this.state.ProtocolVersion) {
         Protocol = protocol,
         Loopback = this.state.ProcessId,
         ParticipantProtocolService = protocolService,
         SupportingToken = coordinator.SuperiorIssuedToken
     };
     if (DebugTrace.Info)
     {
         DebugTrace.TxTrace(TraceLevel.Info, coordinator.EnlistmentId, "Sending Register for {0} to {1}", protocol, Ports.TryGetAddress(coordinator.RegistrationProxy));
     }
     IAsyncResult ar = coordinator.RegistrationProxy.BeginSendRegister(ref register, callback, callbackState);
     if (ar.CompletedSynchronously)
     {
         this.OnSendRegisterComplete(coordinator, protocol, ar);
     }
 }
コード例 #43
0
 /// <summary> 修改控制
 /// </summary>
 /// <param name="subId">子消息ID</param>
 /// <param name="controlType">控制类别</param>
 /// <param name="protocol">协议</param>
 public static void Deal(ControlProtocol protocol)
 {
     //保存至数据库,并返回成功/失败信息
     ThreadPool.QueueUserWorkItem(new WaitCallback(SaveData), protocol);
 }
コード例 #44
0
 protected RegisterParticipantRecordSchema(string transactionId, Guid enlistmentId, ControlProtocol protocol)
 {
     this.transactionId = transactionId;
     this.enlistmentId  = enlistmentId;
     this.protocol      = protocol;
 }
 public static void Trace(Guid enlistmentId, CoordinationContext context, ControlProtocol protocol, Exception e)
 {
     RegistrationCoordinatorFailedSchema extendedData = new RegistrationCoordinatorFailedSchema(context, protocol);
     TxTraceUtility.Trace(TraceEventType.Warning, 0xb0007, Microsoft.Transactions.SR.GetString("RegistrationCoordinatorFailed"), extendedData, null, enlistmentId, null);
 }
 public static void Trace(Guid enlistmentId, CoordinationContext context, ControlProtocol protocol, EndpointAddress coordinatorService, ProtocolVersion protocolVersion)
 {
     RegisterCoordinatorRecordSchema extendedData = RegisterCoordinatorRecordSchema.Instance(context, protocol, coordinatorService, protocolVersion);
     TxTraceUtility.Trace(TraceEventType.Information, GetCode(protocolVersion), Microsoft.Transactions.SR.GetString("RegisterCoordinator"), extendedData, null, enlistmentId, null);
 }
コード例 #47
0
        public static void Trace(Guid enlistmentId, CoordinationContext context, ControlProtocol protocol, EndpointAddress coordinatorService, ProtocolVersion protocolVersion)
        {
            RegisterCoordinatorRecordSchema extendedData = RegisterCoordinatorRecordSchema.Instance(context, protocol, coordinatorService, protocolVersion);

            TxTraceUtility.Trace(TraceEventType.Information, GetCode(protocolVersion), Microsoft.Transactions.SR.GetString("RegisterCoordinator"), extendedData, null, enlistmentId, null);
        }
コード例 #48
0
        public static void Trace(Guid enlistmentId, string transactionId, ControlProtocol protocol, EndpointAddress participantService, ProtocolVersion protocolVersion)
        {
            RegisterParticipantRecordSchema extendedData = RegisterParticipantRecordSchema.Instance(transactionId, enlistmentId, protocol, participantService, protocolVersion);

            TxTraceUtility.Trace(TraceEventType.Information, GetCode(protocolVersion), Microsoft.Transactions.SR.GetString("RegisterParticipant"), extendedData, null, enlistmentId, null);
        }
 public RegistrationCoordinatorFaultedSchema(CoordinationContext context, ControlProtocol protocol, MessageFault fault)
 {
     this.context = context;
     this.protocol = protocol;
     this.fault = fault;
 }
 public void SendRegisterResponse(Microsoft.Transactions.Wsat.Protocol.TransactionEnlistment enlistment, Microsoft.Transactions.Wsat.Messaging.RequestAsyncResult result, ControlProtocol protocol, EndpointAddress coordinatorService)
 {
     RegisterResponse response = new RegisterResponse(this.state.ProtocolVersion) {
         CoordinatorProtocolService = coordinatorService
     };
     if (DebugTrace.Info)
     {
         DebugTrace.TxTrace(TraceLevel.Info, enlistment.EnlistmentId, "Sending RegisterResponse for {0}", protocol);
     }
     RegistrationProxy.SendRegisterResponse(result, ref response);
 }
 public RegistrationCoordinatorFailedSchema(CoordinationContext context, ControlProtocol protocol)
 {
     this.context  = context;
     this.protocol = protocol;
 }
 protected RegisterCoordinatorRecordSchema(CoordinationContext context, ControlProtocol protocol)
 {
     this.context  = context;
     this.protocol = protocol;
 }
コード例 #53
0
 public RegistrationCoordinatorResponseInvalidMetadataSchema10(CoordinationContext context, ControlProtocol protocol, EndpointAddress coordinatorService) : base(context, protocol)
 {
     base.schemaId = "http://schemas.microsoft.com/2006/08/ServiceModel/RegistrationCoordinatorResponseInvalidMetadataTraceRecord";
     if (coordinatorService != null)
     {
         this.coordinatorService = EndpointAddressAugust2004.FromEndpointAddress(coordinatorService);
     }
 }