use of org.apache.cxf.anonymous_complex_type.AnonymousComplexType in project cxf by apache.
the class SpringBeansTest method testNamespaceMapping.
private void testNamespaceMapping(ApplicationContext ctx) throws Exception {
AnonymousComplexType act = (AnonymousComplexType) ctx.getBean("bookClient");
Client client = ClientProxy.getClient(act);
assertNotNull(act);
StringWriter logWriter = new StringWriter();
PrintWriter writer = new PrintWriter(logWriter);
LoggingInInterceptor spy = new LoggingInInterceptor(writer);
client.getInInterceptors().add(spy);
Names n = act.splitName("Hello There");
assertEquals("Hello", n.getFirst());
assertTrue(logWriter.toString().contains("BeepBeep:"));
}
use of org.apache.cxf.anonymous_complex_type.AnonymousComplexType in project cxf by apache.
the class ClientServerMiscTest method testAnonymousComplexType.
@Test
public void testAnonymousComplexType() throws Exception {
AnonymousComplexTypeService actService = new AnonymousComplexTypeService();
assertNotNull(actService);
QName portName = new QName("http://cxf.apache.org/anonymous_complex_type/", "anonymous_complex_typeSOAP");
AnonymousComplexType act = actService.getPort(portName, AnonymousComplexType.class);
updateAddressPort(act, PORT);
try {
Names reply = act.splitName("Tom Li");
assertNotNull("no response received from service", reply);
assertEquals("Tom", reply.getFirst());
assertEquals("Li", reply.getSecond());
} catch (UndeclaredThrowableException ex) {
throw (Exception) ex.getCause();
}
}
use of org.apache.cxf.anonymous_complex_type.AnonymousComplexType in project cxf by apache.
the class ClientServerMiscTest method testRefAnonymousComplexType.
@Test
public void testRefAnonymousComplexType() throws Exception {
AnonymousComplexTypeService actService = new AnonymousComplexTypeService();
assertNotNull(actService);
QName portName = new QName("http://cxf.apache.org/anonymous_complex_type/", "anonymous_complex_typeSOAP");
AnonymousComplexType act = actService.getPort(portName, AnonymousComplexType.class);
updateAddressPort(act, PORT);
try {
SplitName name = new SplitName();
name.setName("Tom Li");
RefSplitName refName = new RefSplitName();
refName.setSplitName(name);
RefSplitNameResponse reply = act.refSplitName(refName);
assertNotNull("no response received from service", reply);
assertEquals("Tom", reply.getSplitNameResponse().getNames().getFirst());
assertEquals("Li", reply.getSplitNameResponse().getNames().getSecond());
} catch (UndeclaredThrowableException ex) {
throw (Exception) ex.getCause();
}
}
Aggregations