Example #1
0
        public override void WriteTransaction(Transaction transaction, Message message)
        {
            CoordinationContext          context;
            RequestSecurityTokenResponse response;

            this.EnsureInitialized();
            this.ForcePromotion(transaction);
            this.MarshalAsCoordinationContext(transaction, out context, out response);
            if (response != null)
            {
                CoordinationServiceSecurity.AddIssuedToken(message, response);
            }
            WsatTransactionHeader header = new WsatTransactionHeader(context, this.protocolVersion);

            message.Headers.Add(header);
        }
Example #2
0
        //=======================================================================================
        // The demand is not added now (in 4.5), to avoid a breaking change. To be considered in the next version.

        /*
         * [PermissionSet(SecurityAction.Demand, Unrestricted = true)] // because we call code from a non-APTCA assembly; WSATs are not supported in partial trust, so customers should not be broken by this demand
         */
        public override void WriteTransaction(Transaction transaction, Message message)
        {
            EnsureInitialized();

            ForcePromotion(transaction);

            // Make a context and add it to the message
            CoordinationContext          context;
            RequestSecurityTokenResponse issuedToken;

            MarshalAsCoordinationContext(transaction, out context, out issuedToken);
            if (issuedToken != null)
            {
                CoordinationServiceSecurity.AddIssuedToken(message, issuedToken);
            }

            WsatTransactionHeader header = new WsatTransactionHeader(context, this.protocolVersion);

            message.Headers.Add(header);
        }