/// <summary>
        /// Constructs a new instance of the CDSExecutionMessageWrapper exception.
        /// </summary>
        /// <param name="message">The message instance to wrap.</param>
        /// <param name="innerException">An optional inner exception.</param>
        public CDSExecutionMessageWrapper(CDSExecutionMessage message, Exception innerException) : base(message.message.value, innerException) 
        { 
            if (message == null)
            {
                throw new ArgumentNullException("message");
            }

            ExecutionMessage = message;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Constructs a new instance of the CDSExecutionMessageWrapper exception.
        /// </summary>
        /// <param name="message">The message instance to wrap.</param>
        /// <param name="innerException">An optional inner exception.</param>
        public CDSExecutionMessageWrapper(CDSExecutionMessage message, Exception innerException) : base(message.message.value, innerException)
        {
            if (message == null)
            {
                throw new ArgumentNullException("message");
            }

            ExecutionMessage = message;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Base-64 encodes an execution message payload.
        /// </summary>
        /// <param name="response">The execution message to be encoded.</param>
        /// <returns>A base-64 string containing the message document.</returns>
        public static string EncodeExecutionMessagePayload(CDSExecutionMessage response)
        {
            var sb = new StringBuilder();

            using (var writer = new StringWriter(sb))
            {
                executionMessageSerializer.Serialize(writer, response);
            }

            var bytes = Encoding.UTF8.GetBytes(sb.ToString());

            return(Convert.ToBase64String(bytes));
        }
 /// <summary>
 /// Constructs a new instance of the CDSExecutionMessageWrapper exception.
 /// </summary>
 /// <param name="message">The message instance to wrap.</param>
 public CDSExecutionMessageWrapper(CDSExecutionMessage message) : this(message, null) { }
Ejemplo n.º 5
0
        /// <summary>
        /// Base-64 encodes an execution message payload.
        /// </summary>
        /// <param name="response">The execution message to be encoded.</param>
        /// <returns>A base-64 string containing the message document.</returns>
        public static string EncodeExecutionMessagePayload(CDSExecutionMessage response)
        {
            var sb = new StringBuilder();
            using (var writer = new StringWriter(sb))
            {
                executionMessageSerializer.Serialize(writer, response);
            }

            var bytes = Encoding.UTF8.GetBytes(sb.ToString());
            return Convert.ToBase64String(bytes);
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Constructs a new instance of the CDSExecutionMessageWrapper exception.
 /// </summary>
 /// <param name="message">The message instance to wrap.</param>
 public CDSExecutionMessageWrapper(CDSExecutionMessage message) : this(message, null)
 {
 }