예제 #1
0
        /// <summary>
        /// Handles the resulted context.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public HttpResult Handle(MessagingContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            if (context.ReceivedMessage == null)
            {
                throw new ArgumentNullException(nameof(context.ReceivedMessage));
            }

            Logger.Debug("Respond with 200 OK: AS4Message is result of pulling");

            // When we're sending as a puller, make sure that the message that has been received,
            // is directly written to the stream.
            return(HttpResult.FromStream(
                       HttpStatusCode.OK,
                       context.ReceivedMessage.UnderlyingStream,
                       context.ReceivedMessage.ContentType));
        }