Exemplo n.º 1
0
        /// <summary>
        /// Insert an <see cref="InException"/> based on an exception that occured during an incoming operation for which we do not have a valid/complete message.
        /// Example: transformation.
        /// </summary>
        /// <param name="exception">The exception which message will be inserted.</param>
        /// <param name="messageStream">The stream that represents the message which caused the exception.</param>
        public async Task InsertIncomingExceptionAsync(Exception exception, Stream messageStream)
        {
            string location = await _bodyStore.SaveAS4MessageStreamAsync(
                _config.InExceptionStoreLocation,
                messageStream);

            InException entity = InException.ForMessageBody(location, exception);

            _repository.InsertInException(entity);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Insert an <see cref="InException"/> based on an exception that occurred dring the incoming Submit operation.
        /// </summary>
        /// <param name="exception">The exception which message will be inserted.</param>
        /// <param name="submit">The original message that caused the exception.</param>
        /// <param name="pmode">The PMode that was being used during the Submit operation.</param>
        public async Task <InException> InsertIncomingSubmitExceptionAsync(
            Exception exception,
            SubmitMessage submit,
            ReceivingProcessingMode pmode)
        {
            Stream stream = await AS4XmlSerializer.ToStreamAsync(submit);

            string location = await _bodyStore.SaveAS4MessageStreamAsync(
                _config.InExceptionStoreLocation,
                stream);

            InException entity =
                InException
                .ForMessageBody(messageLocation: location, exception: exception)
                .SetOperationFor(pmode?.ExceptionHandling);

            await entity.SetPModeInformationAsync(pmode);

            _repository.InsertInException(entity);

            return(entity);
        }