Package wssec.wssec10

Examples of wssec.wssec10.PingService


    @Test
    public void testClientServerComplexPolicyAuthorized() {

        String configName = "org/apache/cxf/systest/ws/wssec10/client_restricted.xml";
        Bus bus = new SpringBusFactory().createBus(configName);
        IPingService port = getComplexPolicyPort(bus);
       
        final String output = port.echo(INPUT);
        assertEquals(INPUT, output);
       
        bus.shutdown(true);
    }
View Full Code Here


    @Test
    public void testClientServerComplexPolicyUnauthorized() {

        String configName = "org/apache/cxf/systest/ws/wssec10/client_restricted_unauthorized.xml";
        Bus bus = new SpringBusFactory().createBus(configName);
        IPingService port = getComplexPolicyPort(bus);
       
        try {
            port.echo(INPUT);
            fail("Frank is unauthorized");
        } catch (Exception ex) {
            assertEquals("Unauthorized", ex.getMessage());
        }
       
View Full Code Here

   
    private static IPingService getComplexPolicyPort(Bus bus) {
        BusFactory.setDefaultBus(bus);
        BusFactory.setThreadDefaultBus(bus);
        PingService svc = new PingService(getWsdlLocation("UserNameOverTransport"));
        final IPingService port =
            svc.getPort(
                new QName(
                    "http://WSSec/wssec10",
                    "UserNameOverTransport" + "_IPingService"
                ),
View Full Code Here

        URL wsdlLocation = null;
        for (String portPrefix : argv) {
            PingService svc = null;
            wsdlLocation = getWsdlLocation(portPrefix);
            svc = new PingService(wsdlLocation);
            final IPingService port =
                svc.getPort(
                    new QName(
                        "http://WSSec/wssec10",
                        portPrefix + "_IPingService"
                    ),
                    IPingService.class
                );
        
            Client cl = ClientProxy.getClient(port);
           
            HTTPConduit http = (HTTPConduit) cl.getConduit();
            
            HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
            httpClientPolicy.setConnectionTimeout(0);
            httpClientPolicy.setReceiveTimeout(0);
            
            http.setClient(httpClientPolicy);
            String output = port.echo(INPUT);
            assertEquals(INPUT, output);
           
            cl.destroy();
        }
       
View Full Code Here

        URL wsdlLocation = null;
        for (String portPrefix : argv) {
            PingService svc = null;
            wsdlLocation = getWsdlLocation(portPrefix);
            svc = new PingService(wsdlLocation);
            final IPingService port =
                svc.getPort(
                    new QName(
                        "http://WSSec/wssec10",
                        portPrefix + "_IPingService"
                    ),
                    IPingService.class
                );
        
            // Streaming
            ((BindingProvider)port).getRequestContext().put(
                SecurityConstants.ENABLE_STREAMING_SECURITY, "true"
            );
            ((BindingProvider)port).getResponseContext().put(
                SecurityConstants.ENABLE_STREAMING_SECURITY, "true"
            );
            Client cl = ClientProxy.getClient(port);
           
            HTTPConduit http = (HTTPConduit) cl.getConduit();
            
            HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
            httpClientPolicy.setConnectionTimeout(0);
            httpClientPolicy.setReceiveTimeout(0);
            
            http.setClient(httpClientPolicy);
            String output = port.echo(INPUT);
            assertEquals(INPUT, output);
           
            cl.destroy();
        }
       
View Full Code Here

    @Test
    public void testClientServerUTOnlyAuthorized() throws IOException {

        String configName = "org/apache/cxf/systest/ws/wssec10/client/client_restricted.xml";
        Bus bus = new SpringBusFactory().createBus(configName);
        IPingService port = getUTOnlyPort(bus, false);
       
        final String output = port.echo(INPUT);
        assertEquals(INPUT, output);
       
        ((java.io.Closeable)port).close();
        bus.shutdown(true);
    }
View Full Code Here

    @Test
    public void testClientServerUTOnlyUnauthorized() throws IOException {

        String configName = "org/apache/cxf/systest/ws/wssec10/client/client_restricted_unauthorized.xml";
        Bus bus = new SpringBusFactory().createBus(configName);
        IPingService port = getUTOnlyPort(bus, true);
       
        try {
            port.echo(INPUT);
            fail("Frank is unauthorized");
        } catch (Exception ex) {
            assertEquals("Unauthorized", ex.getMessage());
        }
       
View Full Code Here

    @Test
    public void testClientServerComplexPolicyAuthorized() throws IOException {

        String configName = "org/apache/cxf/systest/ws/wssec10/client/client_restricted.xml";
        Bus bus = new SpringBusFactory().createBus(configName);
        IPingService port = getComplexPolicyPort(bus);
       
        final String output = port.echo(INPUT);
        assertEquals(INPUT, output);
       
        ((java.io.Closeable)port).close();
        bus.shutdown(true);
    }
View Full Code Here

    @Test
    public void testClientServerComplexPolicyUnauthorized() throws IOException {

        String configName = "org/apache/cxf/systest/ws/wssec10/client/client_restricted_unauthorized.xml";
        Bus bus = new SpringBusFactory().createBus(configName);
        IPingService port = getComplexPolicyPort(bus);
       
        try {
            port.echo(INPUT);
            fail("Frank is unauthorized");
        } catch (Exception ex) {
            assertEquals("Unauthorized", ex.getMessage());
        }
       
View Full Code Here

    private static IPingService getComplexPolicyPort(Bus bus) {
       
        BusFactory.setDefaultBus(bus);
        BusFactory.setThreadDefaultBus(bus);
        PingService svc = new PingService(getWsdlLocation("UserNameOverTransport"));
        final IPingService port =
            svc.getPort(
                new QName(
                    "http://WSSec/wssec10",
                    "UserNameOverTransport" + "_IPingService"
                ),
View Full Code Here

TOP

Related Classes of wssec.wssec10.PingService

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.