Package org.apache.axis2.jaxws.message.util

Examples of org.apache.axis2.jaxws.message.util.Reader2Writer


        Source response = callbackHandler.getValue();
        assertNotNull(response);
       
        // Prepare the response content for checking
        XMLStreamReader reader = inputFactory.createXMLStreamReader(response);
        Reader2Writer r2w = new Reader2Writer(reader);
        String responseText = r2w.getAsString();
        TestLogger.logger.debug(responseText);
       
        // Check to make sure the content is correct
        assertTrue(!responseText.contains("soap"));
        assertTrue(!responseText.contains("Envelope"));
        assertTrue(!responseText.contains("Body"));
        assertTrue(responseText.contains("echoStringResponse"));
       
       
        // Invoke a second time to verify
        stream = new ByteArrayInputStream(bytes);
        srcStream = new StreamSource((InputStream) stream);

        TestLogger.logger.debug(">> Invoking async (callback) Dispatch with PAYLOAD mode");
        monitor = dispatch.invokeAsync(srcStream, callbackHandler);

        // Wait for the async response to be returned
        while (!monitor.isDone()) {
            TestLogger.logger.debug(">> Async invocation still not complete");
            Thread.sleep(1000);
        }
       
        response = callbackHandler.getValue();
        assertNotNull(response);
       
        // Prepare the response content for checking
        reader = inputFactory.createXMLStreamReader(response);
        r2w = new Reader2Writer(reader);
        responseText = r2w.getAsString();
        TestLogger.logger.debug(responseText);
       
        // Check to make sure the content is correct
        assertTrue(!responseText.contains("soap"));
        assertTrue(!responseText.contains("Envelope"));
View Full Code Here


        Source response = callbackHandler.getValue();
        assertNotNull(response);

        // Prepare the response content for checking
        XMLStreamReader reader = inputFactory.createXMLStreamReader(response);
        Reader2Writer r2w = new Reader2Writer(reader);
        String responseText = r2w.getAsString();
        TestLogger.logger.debug(responseText);
       
        // Check to make sure the content is correct
        assertTrue(responseText.contains("soap"));
        assertTrue(responseText.contains("Envelope"));
        assertTrue(responseText.contains("Body"));
        assertTrue(responseText.contains("echoStringResponse"));
       
       
        // Invoke a second time to verify
        // We'll need a callback instance to handle the async responses
        callbackHandler = new AsyncCallback<Source>();

        // Create a StreamSource with the desired content
        bytes = DispatchTestConstants.sampleSoapMessage.getBytes();
        stream = new ByteArrayInputStream(bytes);
        srcStream = new StreamSource((InputStream) stream);

        TestLogger.logger.debug(">> Invoking async (callback) Dispatch with MESSAGE mode");
        monitor = dispatch.invokeAsync(srcStream, callbackHandler);

        // Wait for the async response to be returned
        while (!monitor.isDone()) {
            TestLogger.logger.debug(">> Async invocation still not complete");
            Thread.sleep(1000);
        }
       
        response = callbackHandler.getValue();
        assertNotNull(response);

        // Prepare the response content for checking
        reader = inputFactory.createXMLStreamReader(response);
        r2w = new Reader2Writer(reader);
        responseText = r2w.getAsString();
        TestLogger.logger.debug(responseText);
       
        // Check to make sure the content is correct
        assertTrue(responseText.contains("soap"));
        assertTrue(responseText.contains("Envelope"));
View Full Code Here

        Source response = asyncResponse.get();
        assertNotNull(response);
       
        // Prepare the response content for checking
        XMLStreamReader reader = inputFactory.createXMLStreamReader(response);
        Reader2Writer r2w = new Reader2Writer(reader);
        String responseText = r2w.getAsString();
        TestLogger.logger.debug(responseText);
       
        // Check to make sure the content is correct
        assertTrue(!responseText.contains("soap"));
        assertTrue(!responseText.contains("Envelope"));
        assertTrue(!responseText.contains("Body"));
        assertTrue(responseText.contains("echoStringResponse"));
       
        // Invoke a second time to verify
        stream = new ByteArrayInputStream(bytes);
        srcStream = new StreamSource((InputStream) stream);

        TestLogger.logger.debug(">> Invoking async (callback) Dispatch with PAYLOAD mode");
        asyncResponse = dispatch.invokeAsync(srcStream);

        // Wait for the async response to be returned
        while (!asyncResponse.isDone()) {
            TestLogger.logger.debug(">> Async invocation still not complete");
            Thread.sleep(1000);
        }
       
        response = asyncResponse.get();
        assertNotNull(response);
       
        // Prepare the response content for checking
        reader = inputFactory.createXMLStreamReader(response);
        r2w = new Reader2Writer(reader);
        responseText = r2w.getAsString();
        TestLogger.logger.debug(responseText);
       
        // Check to make sure the content is correct
        assertTrue(!responseText.contains("soap"));
        assertTrue(!responseText.contains("Envelope"));
View Full Code Here

        Source response = asyncResponse.get();
        assertNotNull(response);

        // Prepare the response content for checking
        XMLStreamReader reader = inputFactory.createXMLStreamReader(response);
        Reader2Writer r2w = new Reader2Writer(reader);
        String responseText = r2w.getAsString();
        TestLogger.logger.debug(responseText);
       
        // Check to make sure the content is correct
        assertTrue(responseText.contains("soap"));
        assertTrue(responseText.contains("Envelope"));
        assertTrue(responseText.contains("Body"));
        assertTrue(responseText.contains("echoStringResponse"));
       
       
        // Invoke a second time to verify
        stream = new ByteArrayInputStream(bytes);
        srcStream = new StreamSource((InputStream) stream);

        TestLogger.logger.debug(">> Invoking async (callback) Dispatch with MESSAGE mode");
        asyncResponse = dispatch.invokeAsync(srcStream);

        // Wait for the async response to be returned
        while (!asyncResponse.isDone()) {
            TestLogger.logger.debug(">> Async invocation still not complete");
            Thread.sleep(1000);
        }
       
        response = asyncResponse.get();
        assertNotNull(response);

        // Prepare the response content for checking
        reader = inputFactory.createXMLStreamReader(response);
        r2w = new Reader2Writer(reader);
        responseText = r2w.getAsString();
        TestLogger.logger.debug(responseText);
       
        // Check to make sure the content is correct
        assertTrue(responseText.contains("soap"));
        assertTrue(responseText.contains("Envelope"));
View Full Code Here

        assertNotNull("dispatch invoke returned null", response);
       
        // Prepare the response content for checking
        XMLStreamReader reader = inputFactory.createXMLStreamReader(response);
        Reader2Writer r2w = new Reader2Writer(reader);
        String responseText = r2w.getAsString();
        TestLogger.logger.debug(responseText);
       
        // Check to make sure the content is correct
        assertTrue(!responseText.contains("soap"));
        assertTrue(!responseText.contains("Envelope"));
        assertTrue(!responseText.contains("Body"));
        assertTrue(responseText.contains("echoStringResponse"));
       
        // Invoke a second time
        stream = new ByteArrayInputStream(bytes);
        input = new InputSource(stream);
        request = new SAXSource(input);

        TestLogger.logger.debug(">> Invoking sync Dispatch");
        response = dispatch.invoke(request);

        assertNotNull("dispatch invoke returned null", response);
       
        // Prepare the response content for checking
        reader = inputFactory.createXMLStreamReader(response);
        r2w = new Reader2Writer(reader);
        responseText = r2w.getAsString();
        TestLogger.logger.debug(responseText);
       
        // Check to make sure the content is correct
        assertTrue(!responseText.contains("soap"));
        assertTrue(!responseText.contains("Envelope"));
View Full Code Here

        assertNotNull("dispatch invoke returned null", response);
       
        // Prepare the response content for checking
        XMLStreamReader reader = inputFactory.createXMLStreamReader(response);
        Reader2Writer r2w = new Reader2Writer(reader);
        String responseText = r2w.getAsString();
        TestLogger.logger.debug(responseText);
       
        // Check to make sure the content is correct
        assertTrue(responseText.contains("soap"));
        assertTrue(responseText.contains("Envelope"));
        assertTrue(responseText.contains("Body"));
        assertTrue(responseText.contains("echoStringResponse"));
       
       
        // Invoke a second time
        stream = new ByteArrayInputStream(bytes);
        input = new InputSource(stream);
        request = new SAXSource(input);

        TestLogger.logger.debug(">> Invoking sync Dispatch with Message Mode");
        response = dispatch.invoke(request);

        assertNotNull("dispatch invoke returned null", response);
       
        // Prepare the response content for checking
        reader = inputFactory.createXMLStreamReader(response);
        r2w = new Reader2Writer(reader);
        responseText = r2w.getAsString();
        TestLogger.logger.debug(responseText);
       
        // Check to make sure the content is correct
        assertTrue(responseText.contains("soap"));
        assertTrue(responseText.contains("Envelope"));
View Full Code Here

        Source response = callbackHandler.getValue();
        assertNotNull("dispatch invoke returned null", response);
       
        // Prepare the response content for checking
        XMLStreamReader reader = inputFactory.createXMLStreamReader(response);
        Reader2Writer r2w = new Reader2Writer(reader);
        String responseText = r2w.getAsString();
        TestLogger.logger.debug(responseText);
       
        // Check to make sure the content is correct
        assertTrue(!responseText.contains("soap"));
        assertTrue(!responseText.contains("Envelope"));
        assertTrue(!responseText.contains("Body"));
        assertTrue(responseText.contains("echoStringResponse"));
       
       
       
        // Invoke a second time
        callbackHandler = new AsyncCallback<Source>();
        stream = new ByteArrayInputStream(bytes);
        input = new InputSource(stream);
        request = new SAXSource(input);

        TestLogger.logger.debug(">> Invoking async (callback) Dispatch");
        monitor = dispatch.invokeAsync(request, callbackHandler);

        while (!monitor.isDone()) {
            TestLogger.logger.debug(">> Async invocation still not complete");
            Thread.sleep(1000);
        }
       
        response = callbackHandler.getValue();
        assertNotNull("dispatch invoke returned null", response);
       
        // Prepare the response content for checking
        reader = inputFactory.createXMLStreamReader(response);
        r2w = new Reader2Writer(reader);
        responseText = r2w.getAsString();
        TestLogger.logger.debug(responseText);
       
        // Check to make sure the content is correct
        assertTrue(!responseText.contains("soap"));
        assertTrue(!responseText.contains("Envelope"));
View Full Code Here

        Source response = callbackHandler.getValue();
        assertNotNull("dispatch invoke returned null", response);
       
        // Prepare the response content for checking
        XMLStreamReader reader = inputFactory.createXMLStreamReader(response);
        Reader2Writer r2w = new Reader2Writer(reader);
        String responseText = r2w.getAsString();
        TestLogger.logger.debug(responseText);
       
        // Check to make sure the content is correct
        assertTrue(responseText.contains("soap"));
        assertTrue(responseText.contains("Envelope"));
        assertTrue(responseText.contains("Body"));
        assertTrue(responseText.contains("echoStringResponse"));
       
       
        // Invoke a second time to verify
        callbackHandler = new AsyncCallback<Source>();
       
        stream = new ByteArrayInputStream(bytes);
        input = new InputSource(stream);
        request = new SAXSource(input);

        TestLogger.logger.debug(">> Invoking async (callback) Dispatch");
        monitor = dispatch.invokeAsync(request, callbackHandler);

        while (!monitor.isDone()) {
            TestLogger.logger.debug(">> Async invocation still not complete");
            Thread.sleep(1000);
        }
       
        response = callbackHandler.getValue();
        assertNotNull("dispatch invoke returned null", response);
       
        // Prepare the response content for checking
        reader = inputFactory.createXMLStreamReader(response);
        r2w = new Reader2Writer(reader);
        responseText = r2w.getAsString();
        TestLogger.logger.debug(responseText);
       
        // Check to make sure the content is correct
        assertTrue(responseText.contains("soap"));
        assertTrue(responseText.contains("Envelope"));
View Full Code Here

        Source response = asyncResponse.get();
        assertNotNull("dispatch invoke returned null", response);
       
        // Prepare the response content for checking
        XMLStreamReader reader = inputFactory.createXMLStreamReader(response);
        Reader2Writer r2w = new Reader2Writer(reader);
        String responseText = r2w.getAsString();
        TestLogger.logger.debug(responseText);
       
        // Check to make sure the content is correct
        assertTrue(!responseText.contains("soap"));
        assertTrue(!responseText.contains("Envelope"));
        assertTrue(!responseText.contains("Body"));
        assertTrue(responseText.contains("echoStringResponse"));
       
       
        // Invoke a second time to verify
        stream = new ByteArrayInputStream(bytes);
        input = new InputSource(stream);
        request = new SAXSource(input);

        TestLogger.logger.debug(">> Invoking async (polling) Dispatch");
        asyncResponse = dispatch.invokeAsync(request);

        while (!asyncResponse.isDone()) {
            TestLogger.logger.debug(">> Async invocation still not complete");
            Thread.sleep(1000);
        }
       
        response = asyncResponse.get();
        assertNotNull("dispatch invoke returned null", response);
       
        // Prepare the response content for checking
        reader = inputFactory.createXMLStreamReader(response);
        r2w = new Reader2Writer(reader);
        responseText = r2w.getAsString();
        TestLogger.logger.debug(responseText);
       
        // Check to make sure the content is correct
        assertTrue(!responseText.contains("soap"));
        assertTrue(!responseText.contains("Envelope"));
View Full Code Here

        Source response = asyncResponse.get();
        assertNotNull("dispatch invoke returned null", response);
       
        // Prepare the response content for checking
        XMLStreamReader reader = inputFactory.createXMLStreamReader(response);
        Reader2Writer r2w = new Reader2Writer(reader);
        String responseText = r2w.getAsString();
        TestLogger.logger.debug(responseText);
       
        // Check to make sure the content is correct
        assertTrue(responseText.contains("soap"));
        assertTrue(responseText.contains("Envelope"));
        assertTrue(responseText.contains("Body"));
        assertTrue(responseText.contains("echoStringResponse"));
       
       
        // Invoke a second time to verify
        stream = new ByteArrayInputStream(bytes);
        input = new InputSource(stream);
        request = new SAXSource(input);

        TestLogger.logger.debug(">> Invoking async (callback) Dispatch");
        asyncResponse = dispatch.invokeAsync(request);

        while (!asyncResponse.isDone()) {
            TestLogger.logger.debug(">> Async invocation still not complete");
            Thread.sleep(1000);
        }
       
        response = asyncResponse.get();
        assertNotNull("dispatch invoke returned null", response);
       
        // Prepare the response content for checking
        reader = inputFactory.createXMLStreamReader(response);
        r2w = new Reader2Writer(reader);
        responseText = r2w.getAsString();
        TestLogger.logger.debug(responseText);
       
        // Check to make sure the content is correct
        assertTrue(responseText.contains("soap"));
        assertTrue(responseText.contains("Envelope"));
View Full Code Here

TOP

Related Classes of org.apache.axis2.jaxws.message.util.Reader2Writer

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.