Package org.apache.axis2.transport.http.server

Examples of org.apache.axis2.transport.http.server.SimpleResponse.addHeader()


            SOAPHeaderBlock action = soapfactory.createSOAPHeaderBlock("Action", NameSpaceConstants.WSA_NS);
            action.setText(messageEl.getNamespace().getNamespaceURI() + "/" + messageEl.getLocalName());

            client.addHeader(action);
            client.addHeader(msgId);
            client.addHeader(to);
        }
        client.setOptions(opts);
        OMElement responseMessage = client.sendReceive(messageEl);
        client.cleanupTransport();
View Full Code Here


            if (HTTPConstants.HEADER_GET.equals(request.getRequestLine().getMethod())) {
                String uri = request.getRequestLine().getUri();
                log.debug("HTTP GET:" + uri);
                if (uri.equals("/favicon.ico")) {
                    response.setStatusLine(request.getRequestLine().getHttpVersion(), 301, "Redirect");
                    response.addHeader(new Header("Location", "http://ws.apache.org/favicon.ico"));
                    conn.writeResponse(response);
                    return true;
                }
                if (!uri.startsWith("/axis2/services/")) {
                    response.setStatusLine(request.getRequestLine().getHttpVersion(), 301, "Redirect");
View Full Code Here

                    conn.writeResponse(response);
                    return true;
                }
                if (!uri.startsWith("/axis2/services/")) {
                    response.setStatusLine(request.getRequestLine().getHttpVersion(), 301, "Redirect");
                    response.addHeader(new Header("Location", "/axis2/services/"));
                    conn.writeResponse(response);
                    return true;
                }

                if (uri.indexOf("?") < 0) {
View Full Code Here

                if (uri.indexOf("?") < 0) {
                    if (!(uri.endsWith("/axis2/services/") || uri.endsWith("/axis2/services"))) {
                        String serviceName = uri.replaceAll("/axis2/services/", "");
                        if (serviceName.indexOf("/") < 0) {
                            response.addHeader(new Header("Content-Type", "text/html"));
                            String res = HTTPTransportReceiver.printServiceHTML(serviceName, configurationContext);
                            byte[] buf = res.getBytes();
                            response.setBody(new ByteArrayInputStream(buf));
                            conn.writeResponse(response);
                            return true;
View Full Code Here

                if (uri.endsWith("?wsdl")) {
                    String serviceName = uri.substring(uri.lastIndexOf("/") + 1, uri.length() - 5);
                    HashMap services = configurationContext.getAxisConfiguration().getServices();
                    AxisService service = (AxisService) services.get(serviceName);
                    if (service != null) {
                        response.addHeader(new Header("Content-Type", "text/xml"));
//                        String url = conn.getURL(uri.substring(1, uri.length() - 5));
                        String url = conn.getURL("");
                        int ipindex = url.indexOf("//");
                        String ip = null;
                        if (ipindex >= 0) {
View Full Code Here

                if (uri.endsWith("?xsd")) {
                    String serviceName = uri.substring(uri.lastIndexOf("/") + 1, uri.length() - 4);
                    HashMap services = configurationContext.getAxisConfiguration().getServices();
                    AxisService service = (AxisService) services.get(serviceName);
                    if (service != null) {
                        response.addHeader(new Header("Content-Type", "text/xml"));
                        service.printSchema(baos);
                        byte[] buf = baos.toByteArray();
                        response.setBody(new ByteArrayInputStream(buf));
                        conn.writeResponse(response);
                        return true;
View Full Code Here

                        HTTPTransportReceiver.getGetRequestParameters(
                                request.getRequestLine().getUri()));

                if (!processed) {
                    response.setStatusLine(request.getRequestLine().getHttpVersion(), 200, "OK");
                    response.addHeader(new Header("Content-Type", "text/html"));
                    response.setBodyString(
                            HTTPTransportReceiver.getServicesHTML(configurationContext));
                    setResponseHeaders(conn, request, response, 0, msgContext);
                    conn.writeResponse(response);
View Full Code Here

            if (HTTPConstants.HEADER_GET.equals(request.getRequestLine().getMethod())) {
                String uri = request.getRequestLine().getUri();
                log.debug("HTTP GET:" + uri);
                if (uri.equals("/favicon.ico")) {
                    response.setStatusLine(request.getRequestLine().getHttpVersion(), 301, "Redirect");
                    response.addHeader(new Header("Location", "http://ws.apache.org/favicon.ico"));
                    conn.writeResponse(response);
                    return true;
                }
                if (!uri.startsWith("/axis2/services/")) {
                    response.setStatusLine(request.getRequestLine().getHttpVersion(), 301, "Redirect");
View Full Code Here

                    conn.writeResponse(response);
                    return true;
                }
                if (!uri.startsWith("/axis2/services/")) {
                    response.setStatusLine(request.getRequestLine().getHttpVersion(), 301, "Redirect");
                    response.addHeader(new Header("Location", "/axis2/services/"));
                    conn.writeResponse(response);
                    return true;
                }

                if (uri.endsWith("?wsdl")) {
View Full Code Here

                if (uri.endsWith("?wsdl")) {
                    String serviceName = uri.substring(uri.lastIndexOf("/") + 1, uri.length() - 5);
                    HashMap services = configurationContext.getAxisConfiguration().getServices();
                    AxisService service = (AxisService) services.get(serviceName);
                    if (service != null) {
                        response.addHeader(new Header("Content-Type", "text/xml"));
                        String url = conn.getURL(uri.substring(1, uri.length() - 5));
                        service.printWSDL(baos, url);
                        byte[] buf = baos.toByteArray();
                        response.setBody(new ByteArrayInputStream(buf));
                        conn.writeResponse(response);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.