Examples of WSS4JStaxOutInterceptor


Examples of org.apache.cxf.ws.security.wss4j.WSS4JStaxOutInterceptor

        Client client = ClientProxy.getClient(greeter);
        Map<String, Object> props = new HashMap<String, Object>();
        props.put("action", "UsernameToken");
        props.put("user", "alice");
        props.put("passwordType", "PasswordText");
        WSS4JStaxOutInterceptor wss4jOut = new WSS4JStaxOutInterceptor(props);
       
        client.getOutInterceptors().add(wss4jOut);

        ((BindingProvider)greeter).getRequestContext().put("password", "password");
       
        try {
            greeter.greetMe("CXF");
            fail("should fail because of password text instead of digest");
        } catch (Exception ex) {
            //expected
        }
        client.getOutInterceptors().remove(wss4jOut);
       
        props.put("passwordType", "PasswordDigest");
        wss4jOut = new WSS4JStaxOutInterceptor(props);
        client.getOutInterceptors().add(wss4jOut);
        String s = greeter.greetMe("CXF");
        assertEquals("Hello CXF", s);
        client.getOutInterceptors().remove(wss4jOut);
       
        try {
            ((BindingProvider)greeter).getRequestContext().put("password", "foo");
            wss4jOut = new WSS4JStaxOutInterceptor(props);
            client.getOutInterceptors().add(wss4jOut);
            greeter.greetMe("CXF");
            fail("should fail");
        } catch (Exception ex) {
            //expected
        }
        client.getOutInterceptors().remove(wss4jOut);
        try {
            props.put("passwordType", "PasswordText");
            wss4jOut = new WSS4JStaxOutInterceptor(props);
            client.getOutInterceptors().add(wss4jOut);
            ((BindingProvider)greeter).getRequestContext().put("password", "password");
            greeter.greetMe("CXF");
            fail("should fail");
        } catch (Exception ex) {
View Full Code Here

Examples of org.apache.cxf.ws.security.wss4j.WSS4JStaxOutInterceptor

        Client client = ClientProxy.getClient(greeter);
        Map<String, Object> props = new HashMap<String, Object>();
        props.put("action", "UsernameToken");
        props.put("user", "alice");
        props.put("passwordType", "PasswordText");
        WSS4JStaxOutInterceptor wss4jOut = new WSS4JStaxOutInterceptor(props);
       
        client.getOutInterceptors().add(wss4jOut);

        ((BindingProvider)greeter).getRequestContext().put("password", "password");
       
        try {
            greeter.greetMe("CXF");
            fail("should fail because of password text instead of digest");
        } catch (Exception ex) {
            //expected
        }
        client.getOutInterceptors().remove(wss4jOut);
       
        props.put("passwordType", "PasswordDigest");
        wss4jOut = new WSS4JStaxOutInterceptor(props);
        client.getOutInterceptors().add(wss4jOut);
        String s = greeter.greetMe("CXF");
        assertEquals("Hello CXF", s);
        client.getOutInterceptors().remove(wss4jOut);
       
        try {
            ((BindingProvider)greeter).getRequestContext().put("password", "foo");
            wss4jOut = new WSS4JStaxOutInterceptor(props);
            client.getOutInterceptors().add(wss4jOut);
            greeter.greetMe("CXF");
            fail("should fail");
        } catch (Exception ex) {
            //expected
        }
        client.getOutInterceptors().remove(wss4jOut);
        try {
            props.put("passwordType", "PasswordText");
            wss4jOut = new WSS4JStaxOutInterceptor(props);
            client.getOutInterceptors().add(wss4jOut);
            ((BindingProvider)greeter).getRequestContext().put("password", "password");
            greeter.greetMe("CXF");
            fail("should fail");
        } catch (Exception ex) {
View Full Code Here

Examples of org.apache.cxf.ws.security.wss4j.WSS4JStaxOutInterceptor

        bus.getOutInterceptors().add(outInterceptor);
        port.doubleIt(25);
        bus.getOutInterceptors().remove(outInterceptor);
       
        // Streaming
        WSS4JStaxOutInterceptor staxOutInterceptor = new WSS4JStaxOutInterceptor(outProps);
        bus.getOutInterceptors().add(staxOutInterceptor);
        port.doubleIt(25);
       
        ((java.io.Closeable)port).close();
        bus.shutdown(true);
View Full Code Here

Examples of org.apache.cxf.ws.security.wss4j.WSS4JStaxOutInterceptor

            // expected
        }
        bus.getOutInterceptors().remove(outInterceptor);
       
        // Streaming
        WSS4JStaxOutInterceptor staxOutInterceptor = new WSS4JStaxOutInterceptor(outProps);
        bus.getOutInterceptors().add(staxOutInterceptor);
       
        try {
            port.doubleIt(25);
            fail("Failure expected on not signing the Timestamp");
View Full Code Here

Examples of org.apache.cxf.ws.security.wss4j.WSS4JStaxOutInterceptor

            // expected
        }
        bus.getOutInterceptors().remove(outInterceptor);
       
        // Streaming
        WSS4JStaxOutInterceptor staxOutInterceptor = new WSS4JStaxOutInterceptor(outProps);
        bus.getOutInterceptors().add(staxOutInterceptor);
       
        try {
            port.doubleIt(25);
            fail("Failure expected on not signing the Timestamp");
View Full Code Here

Examples of org.apache.cxf.ws.security.wss4j.WSS4JStaxOutInterceptor

        bus.getOutInterceptors().add(outInterceptor);
        port.doubleIt(25);
        bus.getOutInterceptors().remove(outInterceptor);
       
        // Streaming
        WSS4JStaxOutInterceptor staxOutInterceptor = new WSS4JStaxOutInterceptor(outProps);
        bus.getOutInterceptors().add(staxOutInterceptor);
        port.doubleIt(25);
       
        ((java.io.Closeable)port).close();
        bus.shutdown(true);
View Full Code Here

Examples of org.apache.cxf.ws.security.wss4j.WSS4JStaxOutInterceptor

            // expected
        }
        bus.getOutInterceptors().remove(outInterceptor);
       
        // Streaming
        WSS4JStaxOutInterceptor staxOutInterceptor = new WSS4JStaxOutInterceptor(outProps);
        bus.getOutInterceptors().add(staxOutInterceptor);
       
        try {
            port.doubleIt(25);
            fail("Failure expected on not signing the Timestamp");
View Full Code Here

Examples of org.apache.cxf.ws.security.wss4j.WSS4JStaxOutInterceptor

            // expected
        }
        bus.getOutInterceptors().remove(outInterceptor);
       
        // Streaming
        WSS4JStaxOutInterceptor staxOutInterceptor = new WSS4JStaxOutInterceptor(outProps);
        bus.getOutInterceptors().add(staxOutInterceptor);
       
        try {
            port.doubleIt(25);
            fail("Failure expected on not signing the Timestamp");
View Full Code Here

Examples of org.apache.cxf.ws.security.wss4j.WSS4JStaxOutInterceptor

        bus.getOutInterceptors().add(outInterceptor);
        port.doubleIt(25);
        bus.getOutInterceptors().remove(outInterceptor);
       
        // Streaming
        WSS4JStaxOutInterceptor staxOutInterceptor = new WSS4JStaxOutInterceptor(outProps);
        bus.getOutInterceptors().add(staxOutInterceptor);
        port.doubleIt(25);
       
        ((java.io.Closeable)port).close();
        bus.shutdown(true);
View Full Code Here

Examples of org.apache.cxf.ws.security.wss4j.WSS4JStaxOutInterceptor

            // expected
        }
        bus.getOutInterceptors().remove(outInterceptor);
       
        // Streaming
        WSS4JStaxOutInterceptor staxOutInterceptor = new WSS4JStaxOutInterceptor(outProps);
        bus.getOutInterceptors().add(staxOutInterceptor);
       
        try {
            port.doubleIt(25);
            fail("Failure expected on not encrypting the SOAP Body");
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.