Package wssec.wssec10

Examples of wssec.wssec10.IPingService


    @Test
    public void testClientServerComplexPolicyUnauthorized() {

        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

    private static IPingService getUTOnlyPort(Bus bus, boolean hashed) {
       
        BusFactory.setDefaultBus(bus);
        BusFactory.setThreadDefaultBus(bus);
        PingService svc = new PingService(getWsdlLocation(hashed));
        final IPingService port =
            svc.getPort(
                new QName(
                    "http://WSSec/wssec10",
                    hashed ? "UserName_IPingService_hashed" : "UserName_IPingService"
                ),
View Full Code Here

    @Test
    public void testClientServerUTOnlyAuthorized() throws IOException {

        String configName = "org/apache/cxf/systest/ws/wssec10/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_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_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_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

    private static IPingService getUTOnlyPort(Bus bus, boolean hashed) {
       
        BusFactory.setDefaultBus(bus);
        BusFactory.setThreadDefaultBus(bus);
        PingService svc = new PingService(getWsdlLocation(hashed));
        final IPingService port =
            svc.getPort(
                new QName(
                    "http://WSSec/wssec10",
                    hashed ? "UserName_IPingService_hashed" : "UserName_IPingService"
                ),
View Full Code Here

        URL wsdlLocation = null;

        PingService svc = null;
        wsdlLocation = getWsdlLocation(test.prefix);
        svc = new PingService(wsdlLocation);
        final IPingService port =
            svc.getPort(
                new QName(
                    "http://WSSec/wssec10",
                    test.prefix + "_IPingService"
                ),
                IPingService.class
            );
    
        Client cl = ClientProxy.getClient(port);
       
        if (test.streaming) {
            // Streaming
            ((BindingProvider)port).getRequestContext().put(
                SecurityConstants.ENABLE_STREAMING_SECURITY, "true"
            );
            ((BindingProvider)port).getResponseContext().put(
                SecurityConstants.ENABLE_STREAMING_SECURITY, "true"
            );
        }
       
        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

TOP

Related Classes of wssec.wssec10.IPingService

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.