Package org.apache.cxf.frontend

Examples of org.apache.cxf.frontend.ClientProxyFactoryBean.create()


        proxyFac.setServiceClass(CollectionServiceInterface.class);
        proxyFac.setDataBinding(new AegisDatabinding());
        proxyFac.setAddress("local://CollectionService");
        proxyFac.setBus(getBus());

        CollectionServiceInterface csi = (CollectionServiceInterface)proxyFac.create();
        SortedSet<String> strings = new TreeSet<String>();
        strings.add("Able");
        strings.add("Baker");
        String first = csi.takeSortedStrings(strings);
        assertEquals("Able", first);
View Full Code Here


        factory.setWsdlURL(ServerMisc.DOCLIT_CODEFIRST_URL + "?wsdl");
        factory.setServiceName(servName);
        factory.setServiceClass(DocLitWrappedCodeFirstService.class);
        factory.setEndpointName(portName);
       
        DocLitWrappedCodeFirstService port = (DocLitWrappedCodeFirstService) factory.create();       
        assertNotNull(port);

        String echoMsg = port.echo("Hello");
        assertEquals("Hello", echoMsg);
    }
View Full Code Here

          interfacename, endpointUrl);
 
        ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
        factory.setServiceClass(ifaceClazz);
        factory.setAddress(endpointUrl);
        proxyRaw = factory.create();
 
          } else {
        logger.info("{} and {} are not equal", interfacename,
          ir.getJavaType());
          }
View Full Code Here

        try {
            ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
            factory.setServiceClass(GreeterService.class);
            factory.setAddress(address);
            factory.getServiceFactory().setDataBinding(new AegisDatabinding());
            greeter1 = (GreeterService)factory.create();
            useService(greeter1);
        } finally {
            Thread.currentThread().setContextClassLoader(contextLoader);
        }
           
View Full Code Here

                         factory.getFeatures(),
                         factory.getClientFactoryBean(),
                         sd);

            Thread.currentThread().setContextClassLoader(ClientProxyFactoryBean.class.getClassLoader());
            Object proxy = getProxy(factory.create(), iClass);
            getDistributionProvider().addRemoteService(serviceReference);
            return proxy;
        } catch (Exception e) {
            LOG.log(Level.WARNING, "proxy creation failed", e);
        } finally {
View Full Code Here

        factory.setWsdlURL(ServerMisc.DOCLIT_CODEFIRST_URL + "?wsdl");
        factory.setServiceName(servName);
        factory.setServiceClass(DocLitWrappedCodeFirstService.class);
        factory.setEndpointName(portName);
       
        DocLitWrappedCodeFirstService port = (DocLitWrappedCodeFirstService) factory.create();       
        assertNotNull(port);

        String echoMsg = port.echo("Hello");
        assertEquals("Hello", echoMsg);
    }
View Full Code Here

        try {
            ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
            factory.setServiceClass(GreeterService.class);
            factory.setAddress("http://localhost:9090/greeter");
            factory.getServiceFactory().setDataBinding(new AegisDatabinding());
            GreeterService client = (GreeterService)factory.create();
            Map<GreetingPhrase, String> greetings = client.greetMe("Fred");
            Assert.assertEquals("Fred", greetings.get(new GreetingPhrase("Hello")));
            System.out.println("Invocation result: " + greetings);
           
            try {
View Full Code Here

        AegisDatabinding aegisBinding = new AegisDatabinding();
        ClientProxyFactoryBean proxyFactory = new ClientProxyFactoryBean();
        proxyFactory.setDataBinding(aegisBinding);
        proxyFactory.setServiceClass(AuthService.class);
        proxyFactory.setAddress("http://localhost:9002/service");
        AuthService service = (AuthService) proxyFactory.create();
        assertTrue(service.authenticate("Joe", "Joe", "123"));
        assertFalse(service.authenticate("Joe1", "Joe", "fang"));     
        assertTrue(service.authenticate("Joe", null, "123"));
        List<String> list = service.getRoles("Joe");
        assertEquals(3, list.size());
View Full Code Here

        ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
        clientBean.setAddress(ROUTER_ADDRESS);
        clientBean.setServiceClass(HelloService.class);
        clientBean.setBus(bus);

        HelloService client = (HelloService) proxyFactory.create();

        try {
            client.echo("hello world");
            fail("Expect to get an exception here");
        } catch (Exception e) {
View Full Code Here

        ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
        clientBean.setAddress(ROUTER_ADDRESS);
        clientBean.setServiceClass(HelloService.class);
        clientBean.setBus(bus);

        HelloService client = (HelloService) proxyFactory.create();

        String result = client.echo("hello world");
        assertEquals("we should get the right answer from router", result, "echo hello world");

    }
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.