示例#1
0
        internal Task HandleRequest(HttpContext context)
        {
            var       requestContext = HttpRequestContext.CreateContext(_httpSettings, context);
            var       httpInput      = requestContext.GetHttpInput(true);
            Exception requestException;
            Message   requestMessage = httpInput.ParseIncomingMessage(out requestException);

            if ((requestMessage == null) && (requestException == null))
            {
                throw Fx.Exception.AsError(
                          new ProtocolException(
                              SR.MessageXmlProtocolError,
                              new XmlException(SR.MessageIsEmpty)));
            }
            requestContext.SetMessage(requestMessage, requestException);
            return(_dispatcher.DispatchAsync(requestContext, _replyChannel, context.RequestAborted));
        }