Exemple #1
0
        public new void ProcessRequest(HttpContext context)
        {
            if (context.Request.HttpMethod == HttpMethods.Get)
            {
                var wsdl = new Soap12WsdlMetadataHandler();
                wsdl.Execute(context);
                return;
            }

            SendOneWay(null);
        }
        public new void ProcessRequest(HttpContext context)
        {
            if (context.Request.HttpMethod == HttpMethods.Get)
            {
                var wsdl = new Soap12WsdlMetadataHandler();
                wsdl.Execute(context);
                return;
            }

            var requestMessage = GetSoap12RequestMessage(context.Request.InputStream);

            SendOneWay(requestMessage);
        }
Exemple #3
0
        public override void ProcessRequest(HttpContextBase context)
        {
            if (context.Request.HttpMethod == HttpMethods.Get)
            {
                var wsdl = new Soap12WsdlMetadataHandler();
                wsdl.Execute(context);
                return;
            }

            var responseMessage = Send(null);

            context.Response.ContentType = GetSoapContentType(context.Request.ContentType);

            HostContext.AppHost.WriteSoapMessage(context.Request.ToRequest(), responseMessage, context.Response.OutputStream);
        }
Exemple #4
0
        public override void ProcessRequest(IHttpRequest httpReq, IHttpResponse httpRes, string operationName)
        {
            if (httpReq.HttpMethod == HttpMethods.Get)
            {
                var wsdl = new Soap12WsdlMetadataHandler();
                wsdl.Execute(httpReq, httpRes);
                return;
            }

            var responseMessage = Send(null, httpReq, httpRes);

            httpRes.ContentType = GetSoapContentType(httpReq.ContentType);
            using (var writer = XmlWriter.Create(httpRes.OutputStream))
            {
                responseMessage.WriteMessage(writer);
            }
        }
Exemple #5
0
        public new void ProcessRequest(HttpContext context)
        {
            if (context.Request.HttpMethod == HttpMethods.Get)
            {
                var wsdl = new Soap12WsdlMetadataHandler();
                wsdl.Execute(context);
                return;
            }

            var responseMessage = Send(null);

            context.Response.ContentType = GetSoapContentType(context.Request.ContentType);
            using (var writer = XmlWriter.Create(context.Response.OutputStream))
            {
                responseMessage.WriteMessage(writer);
            }
        }
Exemple #6
0
        public void Wsdl_state_is_correct()
        {
            using (var appHost = new BasicAppHost().Init())
            {
                var dummyServiceType = GetType();
                appHost.Metadata.Add(dummyServiceType, typeof(GetCustomer), typeof(GetCustomerResponse));
                appHost.Metadata.Add(dummyServiceType, typeof(GetCustomers), typeof(GetCustomersResponse));
                appHost.Metadata.Add(dummyServiceType, typeof(StoreCustomer), null);

                var wsdlGenerator = new Soap12WsdlMetadataHandler();
                var xsdMetadata   = new XsdMetadata(appHost.Metadata);
                var wsdlTemplate  = wsdlGenerator.GetWsdlTemplate(xsdMetadata, "http://w3c.org/types", false, "http://w3c.org/types", "Service Name");

                var soapTypes = appHost.Metadata.GetAllSoapOperationTypes().ToSet();
                Assert.That(wsdlTemplate.ReplyOperationNames, Is.EquivalentTo(xsdMetadata.GetReplyOperationNames(Format.Soap12, soapTypes)));
                Assert.That(wsdlTemplate.OneWayOperationNames, Is.EquivalentTo(xsdMetadata.GetOneWayOperationNames(Format.Soap12, soapTypes)));
            }
        }
Exemple #7
0
        public override void ProcessRequest(IRequest httpReq, IResponse httpRes, string operationName)
        {
            if (httpReq.Verb == HttpMethods.Get)
            {
                var wsdl = new Soap12WsdlMetadataHandler();
                wsdl.Execute(httpReq, httpRes);
                return;
            }

            var responseMessage = Send(null, httpReq, httpRes);

            if (httpRes.IsClosed)
            {
                return;
            }

            HostContext.AppHost.WriteSoapMessage(httpReq, responseMessage, httpRes.OutputStream);
        }
Exemple #8
0
        public override Task ProcessRequestAsync(IRequest httpReq, IResponse httpRes, string operationName)
        {
            if (httpReq.Verb == HttpMethods.Get)
            {
                var wsdl = new Soap12WsdlMetadataHandler();
                return(wsdl.ProcessRequestAsync(httpReq, httpRes, operationName));
            }

            var responseMessage = Send(null, httpReq, httpRes);

            if (httpRes.IsClosed)
            {
                return(TypeConstants.EmptyTask);
            }

            HostContext.AppHost.WriteSoapMessage(httpReq, responseMessage, httpRes.OutputStream);

            return(TypeConstants.EmptyTask);
        }
Exemple #9
0
        public override void ProcessRequest(IRequest httpReq, IResponse httpRes, string operationName)
        {
            if (httpReq.Verb == HttpMethods.Get)
            {
                var wsdl = new Soap12WsdlMetadataHandler();
                wsdl.Execute(httpReq, httpRes);
                return;
            }

            var responseMessage = Send(null, httpReq, httpRes);

            if (httpRes.IsClosed)
            {
                return;
            }

            using (var writer = CreateXmlWriter(httpRes.OutputStream))
            {
                responseMessage.WriteMessage(writer);
            }
        }
Exemple #10
0
        /// <summary>Enables processing of HTTP Web requests by a custom HttpHandler that implements the <see cref="T:System.Web.IHttpHandler" /> interface.</summary>
        ///
        /// <param name="context">An <see cref="T:System.Web.HttpContext" /> object that provides references to the intrinsic server objects (for example, Request, Response, Session, and Server) used to
        /// service HTTP requests.
        /// </param>
        public new void ProcessRequest(HttpContext context)
        {
            if (context.Request.HttpMethod == HttpMethods.Get)
            {
                var wsdl = new Soap12WsdlMetadataHandler();
                wsdl.Execute(context);
                return;
            }

            var responseMessage = Send(null);

            context.Response.ContentType = GetSoapContentType(context.Request.ContentType);
            var _settings = new XmlWriterSettings {
                OmitXmlDeclaration = true, ConformanceLevel = ConformanceLevel.Fragment, Encoding = new UTF8Encoding(false)
            };

            using (var writer = XmlWriter.Create(context.Response.OutputStream, _settings))
            {
                responseMessage.WriteMessage(writer);
            }
        }
Exemple #11
0
        /// <summary>Process the request.</summary>
        ///
        /// <param name="httpReq">      The HTTP request.</param>
        /// <param name="httpRes">      The HTTP resource.</param>
        /// <param name="operationName">Name of the operation.</param>
        public override void ProcessRequest(IHttpRequest httpReq, IHttpResponse httpRes, string operationName)
        {
            if (httpReq.HttpMethod == HttpMethods.Get)
            {
                var wsdl = new Soap12WsdlMetadataHandler();
                wsdl.Execute(httpReq, httpRes);
                return;
            }

            var responseMessage = Send(null, httpReq, httpRes);

            httpRes.ContentType = GetSoapContentType(httpReq.ContentType);
            var _settings = new XmlWriterSettings {
                OmitXmlDeclaration = true, ConformanceLevel = ConformanceLevel.Fragment, Encoding = new UTF8Encoding(false)
            };

            using (var writer = XmlWriter.Create(httpRes.OutputStream, _settings))
            {
                responseMessage.WriteMessage(writer);
            }
        }