use of org.apache.cxf.ext.logging.LoggingInInterceptor in project cxf by apache.
the class AegisClientServerTest method testReturnGenericPair.
@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);
}
use of org.apache.cxf.ext.logging.LoggingInInterceptor in project cxf by apache.
the class AegisClientServerTest method testGenericCollection.
@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<>();
list.add("ffang");
String ret = service.getGeneric(list);
assertEquals(ret, "ffang");
}
use of org.apache.cxf.ext.logging.LoggingInInterceptor in project cxf by apache.
the class AegisClientServerTest method testCollection.
@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());
// CXF-1251
String s = service.testForMinOccurs0("A", null, "b");
assertEquals("Anullb", s);
}
use of org.apache.cxf.ext.logging.LoggingInInterceptor in project cxf by apache.
the class MultipleServiceShareClassTest method createGetterService.
private <T extends Getter> T createGetterService(final Class<T> serviceClass) {
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setAddress("http://localhost:" + PORT + "/" + serviceClass.getSimpleName());
factory.getInInterceptors().add(new LoggingInInterceptor());
factory.getOutInterceptors().add(new LoggingOutInterceptor());
return factory.create(serviceClass);
}
use of org.apache.cxf.ext.logging.LoggingInInterceptor in project cxf by apache.
the class SpringBeansTest method testClientFromFactory.
@Test
public void testClientFromFactory() throws Exception {
AbstractFactoryBeanDefinitionParser.setFactoriesAreAbstract(false);
ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(new String[] { "/org/apache/cxf/jaxws/spring/clients.xml" });
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
Greeter g = factory.create(Greeter.class);
ClientImpl c = (ClientImpl) ClientProxy.getClient(g);
for (Interceptor<? extends Message> i : c.getInInterceptors()) {
if (i instanceof LoggingInInterceptor) {
ctx.close();
return;
}
}
ctx.close();
fail("Did not configure the client");
}
Aggregations