public RegisterResponse(Microsoft.Transactions.Wsat.Protocol.ProtocolVersion protocolVersion)
 {
     this.CoordinatorProtocolService       = null;
     this.protocolVersion                  = protocolVersion;
     this.coordinationStrings              = CoordinationStrings.Version(protocolVersion);
     this.coordinationXmlDictionaryStrings = CoordinationXmlDictionaryStrings.Version(protocolVersion);
 }
 public CoordinationContext(Microsoft.Transactions.Wsat.Protocol.ProtocolVersion protocolVersion)
 {
     this.coordinationStrings = CoordinationStrings.Version(protocolVersion);
     this.coordinationXmlDictionaryStrings      = CoordinationXmlDictionaryStrings.Version(protocolVersion);
     this.atomicTransactionXmlDictionaryStrings = AtomicTransactionXmlDictionaryStrings.Version(protocolVersion);
     this.protocolVersion = protocolVersion;
 }
Пример #3
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);
        }
 public CreateCoordinationContextResponse(Microsoft.Transactions.Wsat.Protocol.ProtocolVersion protocolVersion)
 {
     this.CoordinationContext = null;
     this.IssuedToken         = null;
     this.protocolVersion     = protocolVersion;
     this.coordinationStrings = CoordinationStrings.Version(protocolVersion);
     this.coordinationXmlDictionaryStrings = CoordinationXmlDictionaryStrings.Version(protocolVersion);
 }
Пример #5
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);
 }
Пример #6
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 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);
 }
Пример #8
0
 public void Start()
 {
     try
     {
         if (DebugTrace.Verbose)
         {
             DebugTrace.Trace(TraceLevel.Verbose, "Opening ServiceHost for {0}", base.SingletonInstance.GetType().Name);
         }
         if (this.service.Config.SupportingTokensEnabled && (base.SingletonInstance is IWSRegistrationCoordinator))
         {
             foreach (ServiceEndpoint endpoint in base.Description.Endpoints)
             {
                 CustomBinding          binding = new CustomBinding(endpoint.Binding);
                 SecurityBindingElement element = binding.Elements.Find <SecurityBindingElement>();
                 CoordinationStrings    strings = CoordinationStrings.Version(this.service.ProtocolVersion);
                 if (element != null)
                 {
                     if (!element.OptionalOperationSupportingTokenParameters.ContainsKey(strings.RegisterAction))
                     {
                         element.OptionalOperationSupportingTokenParameters.Add(strings.RegisterAction, new SupportingTokenParameters());
                     }
                     element.OptionalOperationSupportingTokenParameters[strings.RegisterAction].Endorsing.Add(CoordinationServiceSecurity.SecurityContextSecurityTokenParameters);
                     endpoint.Binding = binding;
                 }
             }
         }
         base.Open();
         if (DebugTrace.Verbose)
         {
             DebugTrace.Trace(TraceLevel.Verbose, "Opened ServiceHost for {0}", base.SingletonInstance.GetType().Name);
         }
     }
     catch (CommunicationException exception)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new MessagingInitializationException(Microsoft.Transactions.SR.GetString("ListenerCannotBeStarted", new object[] { this.baseEndpoint.Uri, exception.Message }), exception));
     }
 }
Пример #9
0
 public RegisterMessage(MessageVersion version, ref Register registerBody) : base(CoordinationStrings.Version(registerBody.ProtocolVersion).RegisterAction, version)
 {
     this.register = registerBody;
 }
 public IdentifierElement(ProtocolVersion protocolVersion, string identifier)
 {
     this.identifier          = identifier;
     this.coordinationStrings = CoordinationStrings.Version(protocolVersion);
 }
        public static RequestSecurityTokenResponse GetIssuedToken(Message message, string identifier, ProtocolVersion protocolVersion)
        {
            ICollection <RequestSecurityTokenResponse> is2 = TransactionFlowProperty.TryGetIssuedTokens(message);

            if (is2 == null)
            {
                if (DebugTrace.Verbose)
                {
                    DebugTrace.Trace(TraceLevel.Verbose, "No issued tokens found in message");
                }
                return(null);
            }
            string str  = CoordinationStrings.Version(protocolVersion).Identifier;
            string str2 = CoordinationStrings.Version(protocolVersion).Namespace;

            foreach (RequestSecurityTokenResponse response in is2)
            {
                string str3;
                string str4;
                response.GetAppliesToQName(out str3, out str4);
                if ((str3 == str) && (str4 == str2))
                {
                    if (DebugTrace.Verbose)
                    {
                        DebugTrace.Trace(TraceLevel.Verbose, "Found issued token in message");
                    }
                    try
                    {
                        IdentifierElement      appliesTo  = null;
                        DataContractSerializer serializer = IdentifierElementSerializer(protocolVersion);
                        ProtocolVersionHelper.AssertProtocolVersion(protocolVersion, typeof(CoordinationServiceSecurity), "GetIssuedToken");
                        switch (protocolVersion)
                        {
                        case ProtocolVersion.Version10:
                            appliesTo = response.GetAppliesTo <IdentifierElement10>(serializer);
                            break;

                        case ProtocolVersion.Version11:
                            appliesTo = response.GetAppliesTo <IdentifierElement11>(serializer);
                            break;
                        }
                        if (!(appliesTo.Identifier != identifier))
                        {
                            return(response);
                        }
                        if (DebugTrace.Error)
                        {
                            DebugTrace.Trace(TraceLevel.Error, "Issued token identifier does not match expected {0}", identifier);
                        }
                        throw Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(Microsoft.Transactions.SR.GetString("IssuedTokenIdentifierMismatch")));
                    }
                    catch (SerializationException exception)
                    {
                        if (DebugTrace.Error)
                        {
                            DebugTrace.Trace(TraceLevel.Error, "Issued token AppliesTo element could not be deserialized: {0}", exception.Message);
                        }
                        throw Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(exception.Message, exception));
                    }
                    return(response);
                }
            }
            if (DebugTrace.Verbose)
            {
                DebugTrace.Trace(TraceLevel.Verbose, "No matching issued token found in message");
            }
            return(null);
        }
Пример #12
0
 public RegisterResponseMessage(MessageVersion version, ref RegisterResponse response) : base(CoordinationStrings.Version(response.ProtocolVersion).RegisterResponseAction, version)
 {
     this.response = response;
 }
 public CreateCoordinationContextMessage(MessageVersion version, ref CreateCoordinationContext create) : base(CoordinationStrings.Version(create.ProtocolVersion).CreateCoordinationContextAction, version)
 {
     this.create = create;
 }
Пример #14
0
 public CreateCoordinationContextResponseMessage(MessageVersion version, ref CreateCoordinationContextResponse response) : base(CoordinationStrings.Version(response.ProtocolVersion).CreateCoordinationContextResponseAction, version)
 {
     this.response = response;
 }