Package wssec.wssc

Examples of wssec.wssc.IPingService


        BusFactory.setDefaultBus(bus);
        BusFactory.setThreadDefaultBus(bus);
       
        PingService svc = new PingService();
        for (String portPrefix : argv) {
            final IPingService port =
                svc.getPort(
                    new QName(
                        "http://WSSec/wssc",
                        portPrefix
                    ),
                    IPingService.class
                );
          
            ((BindingProvider)port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
                                                            "http://localhost:9001/" + portPrefix);
            if (portPrefix.charAt(0) == '_') {
                //MS would like the _ versions to send a cancel
                ((BindingProvider)port).getRequestContext()
                    .put(SecurityConstants.STS_TOKEN_DO_CANCEL, Boolean.TRUE);
            }
            PingRequest params = new PingRequest();
            Ping ping = new Ping();
            ping.setOrigin("CXF");
            ping.setScenario("Scenario5");
            ping.setText("ping");
            params.setPing(ping);
            try {
                PingResponse output = port.ping(params);
                assertEquals(OUT, output.getPingResponse().getText());
            } catch (Exception ex) {
                throw new Exception("Error doing " + portPrefix, ex);
            }
        }
View Full Code Here


        for (String portPrefix : argv) {
            PingService svc;
            wsdlLocation = new URL("http://localhost:9001/" + portPrefix + "?wsdl");
           
            svc = new PingService(wsdlLocation);
            final IPingService port =
                svc.getPort(
                    new QName(
                        "http://WSSec/wssc",
                        portPrefix
                    ),
                    IPingService.class
                );
          
           
            if (portPrefix.charAt(0) == '_') {
                //MS would like the _ versions to send a cancel
                ((BindingProvider)port).getRequestContext()
                    .put(SecurityConstants.STS_TOKEN_DO_CANCEL, Boolean.TRUE);
            }
            PingRequest params = new PingRequest();
            Ping ping = new Ping();
            ping.setOrigin("CXF");
            ping.setScenario("Scenario5");
            ping.setText("ping");
            params.setPing(ping);
            try {
                PingResponse output = port.ping(params);
                assertEquals(OUT, output.getPingResponse().getText());
            } catch (Exception ex) {
                throw new Exception("Error doing " + portPrefix, ex);
            }
        }
View Full Code Here

TOP

Related Classes of wssec.wssc.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.