Package org.apache.geronimo.webservices.WebServiceContainer

Examples of org.apache.geronimo.webservices.WebServiceContainer.Response


    }
   
    public void testInvoke() throws Exception {
       
        final Request request = EasyMock.createMock(Request.class);
        final Response response = EasyMock.createMock(Response.class);
       

        transport.activate(new ServerTransportCallback() {

            public void dispatch(InputStreamMessageContext ctx, ServerTransport tport) {
View Full Code Here


    }

    public void testCreateOutputStreamContext() throws IOException {

        MessageContext mc = EasyMock.createMock(MessageContext.class);
        Response resp = EasyMock.createNiceMock(Response.class);
        resp.setStatusCode(200);
        EasyMock.expect(resp.getOutputStream()).andReturn(EasyMock.createNiceMock(OutputStream.class));
       
        EasyMock.expect(mc.get(GeronimoInputStreamMessageContext.RESPONSE))
                .andReturn(resp);
       
        EasyMock.expect(mc.get("foo")).andReturn("ret");
View Full Code Here

         * mappings of the corresponding input message (if any).
         *
         * @param message the message to be sent.
         */
        public void send(Message message) throws IOException {
            Response response = (Response)request.get(Response.class);
           
            // handle response headers
            updateResponseHeaders(message);

            Map<String, List<String>> protocolHeaders =
                (Map<String, List<String>>) message.get(Message.PROTOCOL_HEADERS);

            // set headers of the HTTP response object
            Iterator headers = protocolHeaders.entrySet().iterator();
            while (headers.hasNext()) {
                Map.Entry entry = (Map.Entry) headers.next();
                String headerName = (String) entry.getKey();
                String headerValue = getHeaderValue((List) entry.getValue());
                response.setHeader(headerName, headerValue);
            }
           
            message.setContent(OutputStream.class, new WrappedOutputStream(message, response));
        }
View Full Code Here

         * mappings of the corresponding input message (if any).
         *
         * @param message the message to be sent.
         */
        public void send(Message message) throws IOException {
            Response response = (Response)request.get(Response.class);

            // 1. handle response code
            Integer i = (Integer)message.get(Message.RESPONSE_CODE);
            if (i != null) {
                response.setStatusCode(i.intValue());
            }

            // 2. handle response headers
            updateResponseHeaders(message);

            Map<String, List<String>> protocolHeaders =
                (Map<String, List<String>>)message.get(Message.PROTOCOL_HEADERS);

            // set headers of the HTTP response object
            Iterator headers = protocolHeaders.entrySet().iterator();
            while(headers.hasNext()) {
                Map.Entry entry = (Map.Entry)headers.next();
                String headerName = (String)entry.getKey();
                String headerValue = getHeaderValue((List)entry.getValue());
                response.setHeader(headerName, headerValue);
            }

            //TODO gregw says this should work: current cxf-jetty code wraps output stream.
            //if this doesn't work, we'd see an error from jetty saying you cant write headers to the output stream.
            message.setContent(OutputStream.class, response.getOutputStream());
        }
View Full Code Here

         * mappings of the corresponding input message (if any).
         *
         * @param message the message to be sent.
         */
        public void send(Message message) throws IOException {
            Response response = (Response)request.get(Response.class);
           
            // handle response headers
            updateResponseHeaders(message);

            Map<String, List<String>> protocolHeaders =
                (Map<String, List<String>>) message.get(Message.PROTOCOL_HEADERS);

            // set headers of the HTTP response object
            Iterator headers = protocolHeaders.entrySet().iterator();
            while (headers.hasNext()) {
                Map.Entry entry = (Map.Entry) headers.next();
                String headerName = (String) entry.getKey();
                String headerValue = getHeaderValue((List) entry.getValue());
                response.setHeader(headerName, headerValue);
            }
           
            message.setContent(OutputStream.class, new WrappedOutputStream(message, response));
        }
View Full Code Here

         * mappings of the corresponding input message (if any).
         *
         * @param message the message to be sent.
         */
        public void send(Message message) throws IOException {
            Response response = (Response)request.get(Response.class);
           
            // handle response headers
            updateResponseHeaders(message);

            Map<String, List<String>> protocolHeaders =
                (Map<String, List<String>>) message.get(Message.PROTOCOL_HEADERS);

            // set headers of the HTTP response object
            Iterator headers = protocolHeaders.entrySet().iterator();
            while (headers.hasNext()) {
                Map.Entry entry = (Map.Entry) headers.next();
                String headerName = (String) entry.getKey();
                String headerValue = getHeaderValue((List) entry.getValue());
                response.setHeader(headerName, headerValue);
            }
           
            message.setContent(OutputStream.class, new WrappedOutputStream(message, response));
        }
View Full Code Here

        message.put(Response.class, response);
        messageObserver.onMessage(message);
    }

    public Conduit getBackChannel(Message inMessage, Message partialResponse, EndpointReferenceType address) throws IOException {
        Response response = inMessage.get(Response.class);
        Conduit backChannel;
        Exchange ex = inMessage.getExchange();
        EndpointReferenceType target = address != null
                ? address
                : ex.get(EndpointReferenceType.class);
View Full Code Here

         * mappings of the corresponding input message (if any).
         *
         * @param message the message to be sent.
         */
        public void send(Message message) throws IOException {
            Response response = (Response)request.get(Response.class);

            // 1. handle response code
            Integer i = (Integer)message.get(Message.RESPONSE_CODE);
            if (i != null) {
                response.setStatusCode(i.intValue());
            }

            // 2. handle response headers
            updateResponseHeaders(message);

            Map<String, List<String>> protocolHeaders =
                (Map<String, List<String>>)message.get(Message.PROTOCOL_HEADERS);

            // set headers of the HTTP response object
            Iterator headers = protocolHeaders.entrySet().iterator();
            while(headers.hasNext()) {
                Map.Entry entry = (Map.Entry)headers.next();
                String headerName = (String)entry.getKey();
                String headerValue = getHeaderValue((List)entry.getValue());
                response.setHeader(headerName, headerValue);
            }

            //TODO gregw says this should work: current cxf-jetty code wraps output stream.
            //if this doesn't work, we'd see an error from jetty saying you cant write headers to the output stream.
            message.setContent(OutputStream.class, response.getOutputStream());
        }
View Full Code Here

         * mappings of the corresponding input message (if any).
         *
         * @param message the message to be sent.
         */
        public void send(Message message) throws IOException {
            Response response = (Response)request.get(Response.class);
           
            // handle response headers
            updateResponseHeaders(message);

            Map<String, List<String>> protocolHeaders =
                (Map<String, List<String>>) message.get(Message.PROTOCOL_HEADERS);

            // set headers of the HTTP response object
            Iterator headers = protocolHeaders.entrySet().iterator();
            while (headers.hasNext()) {
                Map.Entry entry = (Map.Entry) headers.next();
                String headerName = (String) entry.getKey();
                String headerValue = getHeaderValue((List) entry.getValue());
                response.setHeader(headerName, headerValue);
            }
           
            message.setContent(OutputStream.class, new WrappedOutputStream(message, response));
        }
View Full Code Here

         * mappings of the corresponding input message (if any).
         *
         * @param message the message to be sent.
         */
        public void send(Message message) throws IOException {
            Response response = (Response)request.get(Response.class);
           
            // handle response headers
            updateResponseHeaders(message);

            Map<String, List<String>> protocolHeaders =
                (Map<String, List<String>>) message.get(Message.PROTOCOL_HEADERS);

            // set headers of the HTTP response object
            Iterator headers = protocolHeaders.entrySet().iterator();
            while (headers.hasNext()) {
                Map.Entry entry = (Map.Entry) headers.next();
                String headerName = (String) entry.getKey();
                String headerValue = getHeaderValue((List) entry.getValue());
                response.setHeader(headerName, headerValue);
            }
           
            message.setContent(OutputStream.class, new WrappedOutputStream(message, response));
        }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.webservices.WebServiceContainer.Response

Copyright © 2018 www.massapicom. 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.