Package javax.xml.ws

Examples of javax.xml.ws.ProtocolException


    }


    private void throwException(String exType) {
        if (exType.contains("ProtocolException")) {
            throw new ProtocolException("from server handler");
        }
    }
View Full Code Here


        try {
           
            GZIPInputStream zipIn = new GZIPInputStream(ctx.getInputStream());
            ctx.setInputStream(zipIn);
        } catch (IOException ex) {
            throw new ProtocolException(ex);
        }
    }
View Full Code Here

        try {
            GZIPOutputStream zipOut = new GZIPOutputStream(ctx.getOutputStream());
            ctx.setOutputStream(zipOut);
        } catch (IOException ex) {
            throw new ProtocolException(ex);
        }
    }
View Full Code Here

    public void testHandleMessageThrowsProtocolException() {

        assertFalse(invoker.faultRaised(ctx));
       
        ProtocolException pe = new ProtocolException("banzai");
        logicalHandlers[1].setException(pe);

        boolean continueProcessing = invoker.invokeLogicalHandlers(false, ctx);
        assertFalse(continueProcessing);
        assertTrue(invoker.faultRaised(ctx));
View Full Code Here

   

    public void testHandleFault() {

        // put invoker into fault state
        ProtocolException pe = new ProtocolException("banzai");
        invoker.setFault(ctx, pe);

        boolean continueProcessing = invoker.invokeLogicalHandlers(false, ctx);
        assertTrue(continueProcessing);
        assertEquals(0, logicalHandlers[0].getHandleMessageCount());
View Full Code Here

    public void testFaultRaised() { 

        assertFalse(invoker.faultRaised(ctx));

        invoker.setFault(ctx, new ProtocolException("test exception"));
        assertTrue(invoker.faultRaised(ctx));

        // reset
        invoker.setFault(ctx, null);
        assertFalse(invoker.faultRaised(ctx));

        invoker.setFault(true);
        assertTrue(invoker.faultRaised(ctx));

        // reset
        invoker.setFault(false);
        invoker.setFault(ctx, null);
        assertFalse(invoker.faultRaised(ctx));

        invoker.setFault(true);
        invoker.setFault(ctx, new ProtocolException("test exception"));
    }
View Full Code Here



    public void testHandleFaultThrowsProtocolException() {

        doHandleFaultExceptionTest(new ProtocolException("banzai"));
    }
View Full Code Here

    }
   
    private void doHandleFaultExceptionTest(RuntimeException e) {

        // put invoker into fault state
        ProtocolException pe = new ProtocolException("banzai");
        invoker.setFault(ctx, pe);

        // throw exception during handleFault processing
        logicalHandlers[0].setException(e);
        boolean continueProcessing = invoker.invokeLogicalHandlers(false, ctx);
View Full Code Here

    private void safeRead(InputStreamMessageContext inContext, MessageContext msgContext) {
        try {
            binding.getBindingImpl().read(inContext, msgContext);
        } catch (IOException ex) {
            LOG.log(Level.SEVERE, "READ_IO_FAILURE_MSG", ex);
            throw new ProtocolException(ex);
        }
    }
View Full Code Here

        TestHandler<LogicalMessageContext> handler2 = new TestHandler<LogicalMessageContext>(false) {
            public boolean handleMessage(LogicalMessageContext ctx) {
                super.handleMessage(ctx);
                Boolean outbound = (Boolean)ctx.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
                if (outbound) {
                    throw new ProtocolException(clientHandlerMessage);
                }  
                return true;
            }
        };
        TestSOAPHandler soapHandler1 = new TestSOAPHandler(false);
View Full Code Here

TOP

Related Classes of javax.xml.ws.ProtocolException

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.