@Test
public void testComplexType() throws Exception {
SOAPServiceRPCLit service = new SOAPServiceRPCLit();
assertNotNull(service);
GreeterRPCLit greeter = service.getPort(portName, GreeterRPCLit.class);
updateAddressPort(greeter, PORT);
MyComplexStruct in = new MyComplexStruct();
in.setElem1("elem1");
in.setElem2("elem2");
in.setElem3(45);
try {
((BindingProvider)greeter).getRequestContext().put("schema-validation-enabled", Boolean.TRUE);
MyComplexStruct out = greeter.sendReceiveData(in);
assertNotNull("no response received from service", out);
assertEquals(in.getElem1(), out.getElem1());
assertEquals(in.getElem2(), out.getElem2());
assertEquals(in.getElem3(), out.getElem3());
} catch (UndeclaredThrowableException ex) {
throw (Exception) ex.getCause();
}
try {
in.setElem2("invalid");
greeter.sendReceiveData(in);
} catch (SOAPFaultException f) {
assertTrue(f.getCause() instanceof UnmarshalException);
}
}