Exemplo n.º 1
0
        protected Faults(ProtocolVersion protocolVersion)
        {
            this.coordinationStrings      = CoordinationStrings.Version(protocolVersion);
            this.atomicTransactionStrings = AtomicTransactionStrings.Version(protocolVersion);
            string    reasonText = Microsoft.Transactions.SR.GetString("InvalidStateReason");
            FaultCode code       = new FaultCode(this.coordinationStrings.InvalidState, this.coordinationStrings.Namespace);

            this.invalidState = new Fault(this.coordinationStrings.FaultAction, code, reasonText);
            string    str2  = Microsoft.Transactions.SR.GetString("InvalidProtocolReason");
            FaultCode code2 = new FaultCode(this.coordinationStrings.InvalidProtocol, this.coordinationStrings.Namespace);

            this.invalidProtocol = new Fault(this.coordinationStrings.FaultAction, code2, str2);
            string    str3  = Microsoft.Transactions.SR.GetString("InvalidParametersReason");
            FaultCode code3 = new FaultCode(this.coordinationStrings.InvalidParameters, this.coordinationStrings.Namespace);

            this.invalidParameters = new Fault(this.coordinationStrings.FaultAction, code3, str3);
            string    str4  = Microsoft.Transactions.SR.GetString("InconsistentInternalStateReason");
            FaultCode code4 = new FaultCode(this.atomicTransactionStrings.InconsistentInternalState, this.atomicTransactionStrings.Namespace);

            this.inconsistentInternalState = new Fault(this.atomicTransactionStrings.FaultAction, code4, str4);
            string    str5  = Microsoft.Transactions.SR.GetString("InvalidPolicyReason");
            FaultCode code5 = new FaultCode("InvalidPolicy", "http://schemas.microsoft.com/ws/2006/02/transactions");

            this.invalidPolicy = new Fault(this.atomicTransactionStrings.FaultAction, code5, str5);
        }
 protected Proxy(CoordinationService coordination, EndpointAddress to, EndpointAddress from)
 {
     this.coordinationService = coordination;
     this.to = to;
     this.from = from;
     this.protocolVersion = coordination.ProtocolVersion;
     this.coordinationStrings = CoordinationStrings.Version(coordination.ProtocolVersion);
     this.atomicTransactionStrings = AtomicTransactionStrings.Version(coordination.ProtocolVersion);
 }
Exemplo n.º 3
0
 protected Proxy(CoordinationService coordination, EndpointAddress to, EndpointAddress from)
 {
     this.coordinationService = coordination;
     this.to                       = to;
     this.from                     = from;
     this.protocolVersion          = coordination.ProtocolVersion;
     this.coordinationStrings      = CoordinationStrings.Version(coordination.ProtocolVersion);
     this.atomicTransactionStrings = AtomicTransactionStrings.Version(coordination.ProtocolVersion);
 }
 public CreateCoordinationContext(Microsoft.Transactions.Wsat.Protocol.ProtocolVersion protocolVersion)
 {
     this.expiration      = 0;
     this.expiresPresent  = false;
     this.CurrentContext  = null;
     this.IssuedToken     = null;
     this.IsolationLevel  = System.Transactions.IsolationLevel.Serializable;
     this.protocolVersion = protocolVersion;
     this.coordinationXmlDictionaryStrings      = CoordinationXmlDictionaryStrings.Version(protocolVersion);
     this.atomicTransactionXmlDictionaryStrings = AtomicTransactionXmlDictionaryStrings.Version(protocolVersion);
     this.atomicTransactionStrings = AtomicTransactionStrings.Version(protocolVersion);
     this.coordinationStrings      = CoordinationStrings.Version(protocolVersion);
 }
 public CreateCoordinationContext(Microsoft.Transactions.Wsat.Protocol.ProtocolVersion protocolVersion)
 {
     this.expiration = 0;
     this.expiresPresent = false;
     this.CurrentContext = null;
     this.IssuedToken = null;
     this.IsolationLevel = System.Transactions.IsolationLevel.Serializable;
     this.protocolVersion = protocolVersion;
     this.coordinationXmlDictionaryStrings = CoordinationXmlDictionaryStrings.Version(protocolVersion);
     this.atomicTransactionXmlDictionaryStrings = AtomicTransactionXmlDictionaryStrings.Version(protocolVersion);
     this.atomicTransactionStrings = AtomicTransactionStrings.Version(protocolVersion);
     this.coordinationStrings = CoordinationStrings.Version(protocolVersion);
 }
        public static ControlProtocol WellKnownNameToProtocol(string name, ProtocolVersion protocolVersion)
        {
            AtomicTransactionStrings strings = AtomicTransactionStrings.Version(protocolVersion);

            if (name == strings.CompletionUri)
            {
                return(ControlProtocol.Completion);
            }
            if (name == strings.Durable2PCUri)
            {
                return(ControlProtocol.Durable2PC);
            }
            if (name == strings.Volatile2PCUri)
            {
                return(ControlProtocol.Volatile2PC);
            }
            return(ControlProtocol.None);
        }
Exemplo n.º 7
0
 public InteropRequestReplyBinding(Uri clientBaseAddress, ProtocolVersion protocolVersion) : base("Interop", AtomicTransactionStrings.Version(protocolVersion).Namespace, protocolVersion)
 {
     this.clientBaseAddress = clientBaseAddress;
 }
 protected NotificationMessage(string action, MessageVersion version, ProtocolVersion protocolVersion) : base(action, version)
 {
     this.atomicTransactionStrings = AtomicTransactionStrings.Version(protocolVersion);
     this.atomicTransactionXmlDictionaryStrings = AtomicTransactionXmlDictionaryStrings.Version(protocolVersion);
 }
 private static void ReadFrom(CoordinationContext that, XmlDictionaryReader reader, XmlDictionaryString localName, XmlDictionaryString ns, Microsoft.Transactions.Wsat.Protocol.ProtocolVersion protocolVersion)
 {
     try
     {
         Uri uri;
         CoordinationXmlDictionaryStrings strings  = CoordinationXmlDictionaryStrings.Version(protocolVersion);
         AtomicTransactionStrings         strings2 = AtomicTransactionStrings.Version(protocolVersion);
         reader.ReadFullStartElement(localName, strings.Namespace);
         reader.MoveToStartElement(strings.Identifier, strings.Namespace);
         that.unknownIdentifierAttributes = ReadOtherAttributes(reader, strings.Namespace);
         that.contextId = reader.ReadElementContentAsString().Trim();
         if ((that.contextId.Length == 0) || (that.contextId.Length > 0x100))
         {
             throw Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidCoordinationContextException(Microsoft.Transactions.SR.GetString("InvalidCoordinationContext")));
         }
         if (!Uri.TryCreate(that.contextId, UriKind.Absolute, out uri))
         {
             throw Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidCoordinationContextException(Microsoft.Transactions.SR.GetString("InvalidCoordinationContext")));
         }
         if (reader.IsStartElement(strings.Expires, strings.Namespace))
         {
             that.unknownExpiresAttributes = ReadOtherAttributes(reader, strings.Namespace);
             int num = reader.ReadElementContentAsInt();
             if (num < 0)
             {
                 throw Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidCoordinationContextException(Microsoft.Transactions.SR.GetString("InvalidCoordinationContext")));
             }
             that.expiration     = (uint)num;
             that.expiresPresent = true;
         }
         reader.MoveToStartElement(strings.CoordinationType, strings.Namespace);
         if (reader.ReadElementContentAsString().Trim() != strings2.Namespace)
         {
             throw Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidCoordinationContextException(Microsoft.Transactions.SR.GetString("InvalidCoordinationContext")));
         }
         that.registrationRef = EndpointAddress.ReadFrom(MessagingVersionHelper.AddressingVersion(protocolVersion), reader, strings.RegistrationService, strings.Namespace);
         if (reader.IsStartElement(XD.DotNetAtomicTransactionExternalDictionary.IsolationLevel, XD.DotNetAtomicTransactionExternalDictionary.Namespace))
         {
             that.isoLevel = (System.Transactions.IsolationLevel)reader.ReadElementContentAsInt();
             if (((that.IsolationLevel < System.Transactions.IsolationLevel.Serializable) || (that.IsolationLevel > System.Transactions.IsolationLevel.Unspecified)) || (that.IsolationLevel == System.Transactions.IsolationLevel.Snapshot))
             {
                 throw Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidCoordinationContextException(Microsoft.Transactions.SR.GetString("InvalidCoordinationContext")));
             }
         }
         if (reader.IsStartElement(XD.DotNetAtomicTransactionExternalDictionary.IsolationFlags, XD.DotNetAtomicTransactionExternalDictionary.Namespace))
         {
             that.isoFlags = (System.ServiceModel.Transactions.IsolationFlags)reader.ReadElementContentAsInt();
         }
         if (reader.IsStartElement(XD.DotNetAtomicTransactionExternalDictionary.Description, XD.DotNetAtomicTransactionExternalDictionary.Namespace))
         {
             that.description = reader.ReadElementContentAsString().Trim();
         }
         if (reader.IsStartElement(XD.DotNetAtomicTransactionExternalDictionary.LocalTransactionId, XD.DotNetAtomicTransactionExternalDictionary.Namespace))
         {
             that.localTxId = reader.ReadElementContentAsGuid();
         }
         if (OleTxTransactionHeader.IsStartPropagationTokenElement(reader))
         {
             that.propToken = OleTxTransactionHeader.ReadPropagationTokenElement(reader);
         }
         if (reader.IsStartElement())
         {
             XmlDocument document = new XmlDocument();
             that.unknownData = new List <System.Xml.XmlNode>(5);
             while (reader.IsStartElement())
             {
                 System.Xml.XmlNode item = document.ReadNode(reader);
                 that.unknownData.Add(item);
             }
         }
         reader.ReadEndElement();
     }
     catch (XmlException exception)
     {
         throw Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidCoordinationContextException(Microsoft.Transactions.SR.GetString("InvalidCoordinationContext"), exception));
     }
 }
 public AbortedMessage(MessageVersion version, ProtocolVersion protocolVersion) : base(AtomicTransactionStrings.Version(protocolVersion).AbortedAction, version, protocolVersion)
 {
 }
Exemplo n.º 11
0
 public PrepareMessage(MessageVersion version, ProtocolVersion protocolVersion) : base(AtomicTransactionStrings.Version(protocolVersion).PrepareAction, version, protocolVersion)
 {
 }
Exemplo n.º 12
0
 protected NotificationMessage(string action, MessageVersion version, ProtocolVersion protocolVersion) : base(action, version)
 {
     this.atomicTransactionStrings = AtomicTransactionStrings.Version(protocolVersion);
     this.atomicTransactionXmlDictionaryStrings = AtomicTransactionXmlDictionaryStrings.Version(protocolVersion);
 }
 public ReadOnlyMessage(MessageVersion version, ProtocolVersion protocolVersion) : base(AtomicTransactionStrings.Version(protocolVersion).ReadOnlyAction, version, protocolVersion)
 {
 }
Exemplo n.º 14
0
 public RollbackMessage(MessageVersion version, ProtocolVersion protocolVersion) : base(AtomicTransactionStrings.Version(protocolVersion).RollbackAction, version, protocolVersion)
 {
 }
Exemplo n.º 15
0
 public CommitMessage(MessageVersion version, ProtocolVersion protocolVersion) : base(AtomicTransactionStrings.Version(protocolVersion).CommitAction, version, protocolVersion)
 {
 }
 public InteropDatagramBinding(ProtocolVersion protocolVersion) : base("Interop", AtomicTransactionStrings.Version(protocolVersion).Namespace, protocolVersion)
 {
 }