Package org.apache.cxf.jaxws

Examples of org.apache.cxf.jaxws.JaxWsProxyFactoryBean


        Server server = sf.create();
        server.getEndpoint().getInInterceptors().add(new LoggingInInterceptor());
        server.getEndpoint().getOutInterceptors().add(new LoggingOutInterceptor());
        server.start();

        JaxWsProxyFactoryBean proxyFac = new JaxWsProxyFactoryBean();
        proxyFac.setAddress("local://StudentServiceDocLiteral");
        proxyFac.setBus(getBus());
        setupAegis(proxyFac.getClientFactoryBean());

        proxyFac.getInInterceptors().add(new LoggingInInterceptor());
        proxyFac.getOutInterceptors().add(new LoggingOutInterceptor());

        StudentServiceDocLiteral clientInterface = proxyFac.create(StudentServiceDocLiteral.class);
        Map<Long, Student> fullMap = clientInterface.getStudentsMap();
        assertNotNull(fullMap);
        Student one = fullMap.get(Long.valueOf(1));
        assertNotNull(one);
        assertEquals("Student1", one.getName());
View Full Code Here


        }
    }

    @Test
    public void testHelloService() throws Exception {
        JaxWsProxyFactoryBean cpfb = new JaxWsProxyFactoryBean();
        String address = serviceURL + "Hello";
        cpfb.setServiceClass(Hello.class);
        cpfb.setAddress(address);
        Hello hello = (Hello) cpfb.create();
        String reply = hello.sayHi(" Willem");
        assertEquals("Get the wrongreply ", reply, "get Willem");
    }
View Full Code Here

    }
   
    @Test
    public void testJaxWsAegisClient() throws Exception {
        AegisDatabinding aegisBinding = new AegisDatabinding();
        JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean();
        proxyFactory.setDataBinding(aegisBinding);
        proxyFactory.setServiceClass(AuthService.class);
        proxyFactory.setAddress("http://localhost:" + PORT + "/jaxwsAndAegis");
        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

    }
   
    @Test
    public void testCollection() throws Exception {
        AegisDatabinding aegisBinding = new AegisDatabinding();
        JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean();
        proxyFactory.setDataBinding(aegisBinding);
        proxyFactory.setServiceClass(SportsService.class);
        proxyFactory.setWsdlLocation("http://localhost:" + PORT + "/jaxwsAndAegisSports?wsdl");
        proxyFactory.getInInterceptors().add(new LoggingInInterceptor());
        proxyFactory.getOutInterceptors().add(new LoggingOutInterceptor());
        SportsService service = (SportsService) proxyFactory.create();

        Collection<Team> teams = service.getTeams();
        assertEquals(1, teams.size());
        assertEquals("Patriots", teams.iterator().next().getName());
       
View Full Code Here

    }
   
    @Test
    public void testComplexMapResult() throws Exception {
        AegisDatabinding aegisBinding = new AegisDatabinding();
        JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean();
        proxyFactory.setDataBinding(aegisBinding);
        proxyFactory.setServiceClass(SportsService.class);
        proxyFactory.setAddress("http://localhost:" + PORT + "/jaxwsAndAegisSports");
        proxyFactory.getInInterceptors().add(new LoggingInInterceptor());
        proxyFactory.getOutInterceptors().add(new LoggingOutInterceptor());
        SportsService service = (SportsService) proxyFactory.create();
        Map<String, Map<Integer, Integer>> result = service.testComplexMapResult();
        assertEquals(result.size(), 1);
        assertTrue(result.containsKey("key1"));
        assertNotNull(result.get("key1"));
        assertEquals(result.toString(), "{key1={1=3}}");
View Full Code Here

    }
   
    @Test
    public void testGenericCollection() throws Exception {
        AegisDatabinding aegisBinding = new AegisDatabinding();
        JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean();
        proxyFactory.setDataBinding(aegisBinding);
        proxyFactory.setServiceClass(SportsService.class);
        proxyFactory.setAddress("http://localhost:" + PORT + "/jaxwsAndAegisSports");
        proxyFactory.getInInterceptors().add(new LoggingInInterceptor());
        proxyFactory.getOutInterceptors().add(new LoggingOutInterceptor());
        SportsService service = (SportsService) proxyFactory.create();
        List<String> list = new ArrayList<String>();
        list.add("ffang");
        String ret = service.getGeneric(list);
        assertEquals(ret, "ffang");
    }
View Full Code Here

    }
   
    @Test
    public void testGenericPair() throws Exception {
        AegisDatabinding aegisBinding = new AegisDatabinding();
        JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean();
        proxyFactory.setDataBinding(aegisBinding);
        proxyFactory.setServiceClass(SportsService.class);
        proxyFactory.setAddress("http://localhost:" + PORT + "/jaxwsAndAegisSports");
        proxyFactory.getInInterceptors().add(new LoggingInInterceptor());
        proxyFactory.getOutInterceptors().add(new LoggingOutInterceptor());
        SportsService service = (SportsService) proxyFactory.create();
        Pair<String, Integer> ret = service.getReturnGenericPair("ffang", 111);
        assertEquals("ffang", ret.getFirst());
        assertEquals(new Integer(111), ret.getSecond());
    }
View Full Code Here

    }
   
    @Test
    public void testReturnQualifiedPair() throws Exception {
        AegisDatabinding aegisBinding = new AegisDatabinding();
        JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean();
        proxyFactory.setDataBinding(aegisBinding);
        proxyFactory.setServiceClass(SportsService.class);
        proxyFactory.setAddress("http://localhost:" + PORT + "/jaxwsAndAegisSports");
        proxyFactory.getInInterceptors().add(new LoggingInInterceptor());
        proxyFactory.getOutInterceptors().add(new LoggingOutInterceptor());
        SportsService service = (SportsService) proxyFactory.create();
        Pair<Integer, String> ret = service.getReturnQualifiedPair(111, "ffang");
        assertEquals(new Integer(111), ret.getFirst());
        assertEquals("ffang", ret.getSecond());
    }
View Full Code Here

   
    @Test
    public void testReturnGenericPair() throws Exception {
        AegisDatabinding aegisBinding = new AegisDatabinding();
        JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean();
        proxyFactory.setDataBinding(aegisBinding);
        proxyFactory.setServiceClass(SportsService.class);
        proxyFactory.setAddress("http://localhost:" + PORT + "/jaxwsAndAegisSports");
        proxyFactory.getInInterceptors().add(new LoggingInInterceptor());
        proxyFactory.getOutInterceptors().add(new LoggingOutInterceptor());
        SportsService service = (SportsService) proxyFactory.create();
        int ret = service.getGenericPair(new Pair<Integer, String>(111, "String"));
        assertEquals(111, ret);
    }
View Full Code Here

    }
   
    @Test
    public void testQualifiedPair() throws Exception {
        AegisDatabinding aegisBinding = new AegisDatabinding();
        JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean();
        proxyFactory.setDataBinding(aegisBinding);
        proxyFactory.setServiceClass(SportsService.class);
        proxyFactory.setAddress("http://localhost:" + PORT + "/jaxwsAndAegisSports");
        proxyFactory.getInInterceptors().add(new LoggingInInterceptor());
        proxyFactory.getOutInterceptors().add(new LoggingOutInterceptor());
        SportsService service = (SportsService) proxyFactory.create();
        int ret = service.getQualifiedPair(new Pair<Integer, String>(111, "ffang"));
        assertEquals(111, ret);
    }
View Full Code Here

TOP

Related Classes of org.apache.cxf.jaxws.JaxWsProxyFactoryBean

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.