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;
 }
 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 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);
 }
 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 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);
 }
Exemplo n.º 7
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));
     }
 }
Exemplo n.º 8
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 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);
        }
Exemplo n.º 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;
 }
Exemplo n.º 14
0
 public CreateCoordinationContextResponseMessage(MessageVersion version, ref CreateCoordinationContextResponse response) : base(CoordinationStrings.Version(response.ProtocolVersion).CreateCoordinationContextResponseAction, version)
 {
     this.response = response;
 }