Ejemplo n.º 1
0
        private static string GetPathRequestInformation(string path, PathActionMapItem pathAction, string messageHandlerName)
        {
            var startIndex = pathAction.Path.Length + messageHandlerName.Length + 1;

            if (startIndex >= path.Length)
            {
                return(string.Empty);
            }

            return(path.Substring(startIndex));
        }
Ejemplo n.º 2
0
        private Task SendMessageAsync(HttpContext context, string path, string messageHandlerName, PathActionMapItem pathAction)
        {
            var method = context.Request.Method;
            var isPost = string.CompareOrdinal("POST", method) == 0;

            return(isPost ? this.ProcessAdd(messageHandlerName, context.Request.Headers, context.Request.Body) : this.ProcessAddSimple(messageHandlerName, GetPathRequestInformation(path, pathAction, messageHandlerName)));
        }
Ejemplo n.º 3
0
        private Task SendAndReceiveMessageWaitAsync(HttpContext context, string path, string messageHandlerName, HttpContextResponseOutputMessagePipeline pipeline, PathActionMapItem pathAction)
        {
            {
                var method = context.Request.Method;
                var isPost = string.CompareOrdinal("POST", method) == 0;

                return(isPost
                           ? this.SendAndReceiveMessageWait(messageHandlerName, context.Request.Body, new ContextIsClientConnected(context), pipeline)
                           : this.SendAndReceiveMessageWait(messageHandlerName, GetPathRequestInformation(path, pathAction, messageHandlerName), new ContextIsClientConnected(context), pipeline));
            }
        }