private async Task ProcessMeta(HttpContext httpContext)
        {
            var baseUrl         = httpContext.Request.Scheme + "://" + httpContext.Request.Host + httpContext.Request.PathBase + httpContext.Request.Path;
            var bodyWriter      = _serializer == SoapSerializer.XmlSerializer ? new MetaBodyWriter(_service, baseUrl, _binding, _xmlNamespaceManager) : (BodyWriter) new MetaWCFBodyWriter(_service, baseUrl, _binding);
            var responseMessage = Message.CreateMessage(_messageEncoders[0].MessageVersion, null, bodyWriter);

            responseMessage = new MetaMessage(responseMessage, _service, _binding, _xmlNamespaceManager);

            httpContext.Response.ContentType = _messageEncoders[0].ContentType;

            await WriteMessageAsync(_messageEncoders[0], responseMessage, httpContext);
        }
Beispiel #2
0
        private async Task ProcessMeta(HttpContext httpContext)
        {
            var baseUrl         = httpContext.Request.Scheme + "://" + httpContext.Request.Host + httpContext.Request.PathBase + httpContext.Request.Path;
            var bodyWriter      = _serializer == SoapSerializer.XmlSerializer ? new MetaBodyWriter(_service, baseUrl, _binding, _xmlNamespaceManager) : (BodyWriter) new MetaWCFBodyWriter(_service, baseUrl, _binding);
            var responseMessage = Message.CreateMessage(_messageEncoders[0].MessageVersion, null, bodyWriter);

            responseMessage = new MetaMessage(responseMessage, _service, _binding, _xmlNamespaceManager);

            //we should use text/xml in wsdl page for browser compability.
            httpContext.Response.ContentType = "text/xml;charset=UTF-8";            // _messageEncoders[0].ContentType;

            await WriteMessageAsync(_messageEncoders[0], responseMessage, httpContext);
        }
Beispiel #3
0
        private Message ProcessMeta(HttpContext httpContext)
        {
            string baseUrl = httpContext.Request.Scheme + "://" + httpContext.Request.Host + httpContext.Request.PathBase + httpContext.Request.Path;

            var bodyWriter = new MetaBodyWriter(_service, baseUrl);

            var responseMessage = Message.CreateMessage(_messageEncoder.MessageVersion, null, bodyWriter);

            responseMessage = new MetaMessage(responseMessage, _service);

            httpContext.Response.ContentType = _messageEncoder.ContentType;
            _messageEncoder.WriteMessage(responseMessage, httpContext.Response.Body);

            return(responseMessage);
        }
        private Message ProcessMeta(HttpContext httpContext)
        {
            MessageEncoder messageEncoder = _messageEncoders[0];
            string         baseUrl        = httpContext.Request.Scheme + "://" + httpContext.Request.Host + httpContext.Request.PathBase + httpContext.Request.Path;

            var bodyWriter = _serializer == SoapSerializer.XmlSerializer ? new MetaBodyWriter(_service, baseUrl, _binding) : (BodyWriter) new MetaWCFBodyWriter(_service, baseUrl, _binding);

            var responseMessage = Message.CreateMessage(messageEncoder.MessageVersion, null, bodyWriter);

            responseMessage = new MetaMessage(responseMessage, _service, _binding);

            httpContext.Response.ContentType = messageEncoder.ContentType;
            messageEncoder.WriteMessage(responseMessage, httpContext.Response.Body);

            return(responseMessage);
        }
        private async Task <Message> ProcessMeta(HttpContext httpContext)
        {
            string baseUrl = httpContext.Request.Scheme + "://" + httpContext.Request.Host + httpContext.Request.PathBase + httpContext.Request.Path;

            var bodyWriter = _serializer == SoapSerializer.XmlSerializer ? new MetaBodyWriter(_service, baseUrl, _binding) : (BodyWriter) new MetaWCFBodyWriter(_service, baseUrl, _binding);

            var responseMessage = Message.CreateMessage(_messageEncoders[0].MessageVersion, null, bodyWriter);

            responseMessage = new MetaMessage(responseMessage, _service, _binding);

            httpContext.Response.ContentType = _messageEncoders[0].ContentType;

#if ASPNET_21
            await _messageEncoders[0].WriteMessageAsync(responseMessage, httpContext.Response.Body);
#endif

#if ASPNET_30
            await _messageEncoders[0].WriteMessageAsync(responseMessage, httpContext.Response.BodyWriter);
#endif

            return(responseMessage);
        }