Package org.apache.cxf.ws.discovery.internal

Examples of org.apache.cxf.ws.discovery.internal.WSDiscoveryServiceImpl


    //this is a standalone test
    public static void main(String[] arg) throws Exception {
        try {
            Bus bus = BusFactory.getDefaultBus();
            Endpoint ep = Endpoint.publish("http://localhost:51919/Foo/Snarf", new FooImpl());
            WSDiscoveryServiceImpl service = new WSDiscoveryServiceImpl(bus);
            service.startup();
           
            //this service will just generate an error.  However, the probes should still
            //work to probe the above stuff.
            WSDiscoveryServiceImpl s2 = new WSDiscoveryServiceImpl() {
                public ProbeMatchesType handleProbe(ProbeType pt) {
                    throw new RuntimeException("Error!!!");
                }
            };
            s2.startup();
            HelloType h = service.register(ep.getEndpointReference());
           
            bus  = BusFactory.newInstance().createBus();
            new LoggingFeature().initialize(bus);
            WSDiscoveryClient c = new WSDiscoveryClient(bus);
View Full Code Here


    }

    private static WSDiscoveryServiceImpl getStaticService() {
        if (staticService == null) {
            Bus bus = BusFactory.newInstance().createBus();
            staticService = new WSDiscoveryServiceImpl(bus);
        }
        return staticService;
    }
View Full Code Here

    //this is a standalone test
    public static void main(String[] arg) throws Exception {
        try {
            Bus bus = BusFactory.getDefaultBus();
            Endpoint ep = Endpoint.publish("http://localhost:51919/Foo/Snarf", new FooImpl());
            WSDiscoveryServiceImpl service = new WSDiscoveryServiceImpl(bus);
            service.startup();
           
            //this service will just generate an error.  However, the probes should still
            //work to probe the above stuff.
            WSDiscoveryServiceImpl s2 = new WSDiscoveryServiceImpl() {
                public ProbeMatchesType handleProbe(ProbeType pt) {
                    throw new RuntimeException("Error!!!");
                }
            };
            s2.startup();
            HelloType h = service.register(ep.getEndpointReference());
           
            bus  = BusFactory.newInstance().createBus();
            new LoggingFeature().initialize(bus);
            WSDiscoveryClient c = new WSDiscoveryClient(bus);
View Full Code Here

   
    public static void main(String[] arg) throws Exception {
        try {
            Bus bus = BusFactory.getDefaultBus();
            Endpoint ep = Endpoint.publish("http://localhost:51919/Foo/Snarf", new FooImpl());
            WSDiscoveryServiceImpl service = new WSDiscoveryServiceImpl(bus);
            service.startup();
            HelloType h = service.register(ep.getEndpointReference());

           
           
            bus  = BusFactory.newInstance().createBus();
            new LoggingFeature().initialize(bus);
            WSDiscoveryClient c = new WSDiscoveryClient(bus);
            c.setVersion10();
           
           
            System.out.println("1");
            ProbeType pt = new ProbeType();
            ScopesType scopes = new ScopesType();
            pt.setScopes(scopes);
            ProbeMatchesType pmts = c.probe(pt);
            System.out.println("2");
            if  (pmts != null) {
                for (ProbeMatchType pmt : pmts.getProbeMatch()) {
                    System.out.println("Found " + pmt.getEndpointReference());
                    System.out.println(pmt.getTypes());
                    System.out.println(pmt.getXAddrs());
                }
            }
            pmts = c.probe(pt);
            System.out.println("3");

            W3CEndpointReference ref = null;
            if  (pmts != null) {
                for (ProbeMatchType pmt : pmts.getProbeMatch()) {
                    ref = pmt.getEndpointReference();
                    System.out.println("Found " + pmt.getEndpointReference());
                    System.out.println(pmt.getTypes());
                    System.out.println(pmt.getXAddrs());
                }
            }
           
            ResolveMatchType rmt = c.resolve(ref);
            System.out.println("Resolved " + rmt.getEndpointReference());
            System.out.println(rmt.getTypes());
            System.out.println(rmt.getXAddrs());

            service.unregister(h);
            System.out.println("4");
            c.close();
           
            System.exit(0);
        } catch (Throwable t) {
View Full Code Here

   
   
    public static void main(String[] arg) throws Exception {
        try {
            Endpoint ep = Endpoint.publish("http://localhost:51919/Foo/Snarf", new FooImpl());
            WSDiscoveryServiceImpl service = new WSDiscoveryServiceImpl(null);
            service.startup();
           
           
            WSDiscoveryClient c = new WSDiscoveryClient();
            HelloType h = service.register(ep.getEndpointReference());
           
           
            System.out.println("1");
            ProbeMatchesType pmts = c.probe(new ProbeType());
            System.out.println("2");
            if  (pmts != null) {
                for (ProbeMatchType pmt : pmts.getProbeMatch()) {
                    System.out.println("Found " + pmt.getEndpointReference());
                    System.out.println(pmt.getTypes());
                    System.out.println(pmt.getXAddrs());
                }
            }
            pmts = c.probe(new ProbeType());
            System.out.println("3");
           
            if  (pmts != null) {
                for (ProbeMatchType pmt : pmts.getProbeMatch()) {
                    System.out.println("Found " + pmt.getEndpointReference());
                    System.out.println(pmt.getTypes());
                    System.out.println(pmt.getXAddrs());
                }
            }
            service.unregister(h);
            System.out.println("4");
            c.close();
           
            System.exit(0);
        } catch (Throwable t) {
View Full Code Here

TOP

Related Classes of org.apache.cxf.ws.discovery.internal.WSDiscoveryServiceImpl

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.