Package org.apache.cxf.systest.ws.policy.javafirst

Examples of org.apache.cxf.systest.ws.policy.javafirst.OperationSimpleService


        ClassPathXmlApplicationContext clientContext = new ClassPathXmlApplicationContext(new String[] {
            "org/apache/cxf/systest/ws/policy/client/sslnocertclient.xml"
        });

        OperationSimpleService simpleService = clientContext
            .getBean("OperationSimpleServiceClient", OperationSimpleService.class);

        // no security on ping!
        simpleService.ping();
       
        try {
            simpleService.doStuff();
            fail("Expected exception as no credentials");
        } catch (SOAPFaultException e) {
            assertTrue(true);
        }

        WSS4JOutInterceptor wssOut = addToClient(simpleService);

        wssOut.setProperties(getNoPasswordProperties("alice"));
        try {
            simpleService.doStuff();
            fail("Expected exception as no password and no client cert");
        } catch (SOAPFaultException e) {
            assertTrue(true);
        }

        // this is successful because the alternative policy allows a password to be specified.
        wssOut.setProperties(getPasswordProperties("alice", "password"));
        simpleService.doStuff();
    }
View Full Code Here


        ClassPathXmlApplicationContext clientContext = new ClassPathXmlApplicationContext(new String[] {
            "org/apache/cxf/systest/ws/policy/client/sslcertclient.xml"
        });

        OperationSimpleService simpleService = clientContext
            .getBean("OperationSimpleServiceClient", OperationSimpleService.class);

        // no security on ping!
        simpleService.ping();
       
        try {
            simpleService.doStuff();
            fail("Expected exception as no credentials");
        } catch (SOAPFaultException e) {
            assertTrue(true);
        }

        WSS4JOutInterceptor wssOut = addToClient(simpleService);

        wssOut.setProperties(getNoPasswordProperties("alice"));
        simpleService.doStuff();

        // this is successful because the alternative policy allows a password to be specified.
        wssOut.setProperties(getPasswordProperties("alice", "password"));
        simpleService.doStuff();
    }
View Full Code Here

        ClassPathXmlApplicationContext clientContext = new ClassPathXmlApplicationContext(new String[] {
            "org/apache/cxf/systest/ws/policy/sslcertclient.xml"
        });

        OperationSimpleService simpleService = clientContext
            .getBean("OperationSimpleServiceClient", OperationSimpleService.class);

        // no security on ping!
        simpleService.ping();
       
        try {
            simpleService.doStuff();
            fail("Expected exception as no credentials");
        } catch (SOAPFaultException e) {
            assertTrue(true);
        }

        WSS4JOutInterceptor wssOut = addToClient(simpleService);

        wssOut.setProperties(getNoPasswordProperties("alice"));
        simpleService.doStuff();

        // this is successful because the alternative policy allows a password to be specified.
        wssOut.setProperties(getPasswordProperties("alice", "password"));
        simpleService.doStuff();
       
        clientContext.close();
    }
View Full Code Here

        ClassPathXmlApplicationContext clientContext = new ClassPathXmlApplicationContext(new String[] {
            "org/apache/cxf/systest/ws/policy/sslnocertclient.xml"
        });

        OperationSimpleService simpleService = clientContext
            .getBean("OperationSimpleServiceClient", OperationSimpleService.class);

        // no security on ping!
        simpleService.ping();
       
        try {
            simpleService.doStuff();
            fail("Expected exception as no credentials");
        } catch (SOAPFaultException e) {
            assertTrue(true);
        }

        WSS4JOutInterceptor wssOut = addToClient(simpleService);

        wssOut.setProperties(getNoPasswordProperties("alice"));
        try {
            simpleService.doStuff();
            fail("Expected exception as no password and no client cert");
        } catch (SOAPFaultException e) {
            assertTrue(true);
        }

        // this is successful because the alternative policy allows a password to be specified.
        wssOut.setProperties(getPasswordProperties("alice", "password"));
        simpleService.doStuff();
       
        clientContext.close();
    }
View Full Code Here

        ClassPathXmlApplicationContext clientContext = new ClassPathXmlApplicationContext(new String[] {
            "org/apache/cxf/systest/ws/policy/client/sslnocertclient.xml"
        });

        OperationSimpleService simpleService = clientContext
            .getBean("OperationSimpleServiceClient", OperationSimpleService.class);

        // no security on ping!
        simpleService.ping();
       
        try {
            simpleService.doStuff();
            fail("Expected exception as no credentials");
        } catch (SOAPFaultException e) {
            assertTrue(true);
        }

        WSS4JOutInterceptor wssOut = addToClient(simpleService);

        wssOut.setProperties(getNoPasswordProperties("alice"));
        try {
            simpleService.doStuff();
            fail("Expected exception as no password and no client cert");
        } catch (SOAPFaultException e) {
            assertTrue(true);
        }

        // this is successful because the alternative policy allows a password to be specified.
        wssOut.setProperties(getPasswordProperties("alice", "password"));
        simpleService.doStuff();
    }
View Full Code Here

        ClassPathXmlApplicationContext clientContext = new ClassPathXmlApplicationContext(new String[] {
            "org/apache/cxf/systest/ws/policy/client/sslcertclient.xml"
        });

        OperationSimpleService simpleService = clientContext
            .getBean("OperationSimpleServiceClient", OperationSimpleService.class);

        // no security on ping!
        simpleService.ping();
       
        try {
            simpleService.doStuff();
            fail("Expected exception as no credentials");
        } catch (SOAPFaultException e) {
            assertTrue(true);
        }

        WSS4JOutInterceptor wssOut = addToClient(simpleService);

        wssOut.setProperties(getNoPasswordProperties("alice"));
        simpleService.doStuff();

        // this is successful because the alternative policy allows a password to be specified.
        wssOut.setProperties(getPasswordProperties("alice", "password"));
        simpleService.doStuff();
    }
View Full Code Here

TOP

Related Classes of org.apache.cxf.systest.ws.policy.javafirst.OperationSimpleService

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.