use of org.jboss.test.ws.jaxws.benchmark.test.complex.types.ValidationFault in project jbossws-cxf by jbossws.
the class RegistrationServiceImpl method bulkRegister.
public List<Long> bulkRegister(List<Customer> customers, Object when) throws AlreadyRegisteredFault_Exception, ValidationFault_Exception {
List<Long> registered = new ArrayList<Long>(customers.size());
List<Long> failed = new ArrayList<Long>(customers.size());
for (Customer c : customers) {
try {
registered.add(register(c, when));
} catch (ValidationFault_Exception e) {
failed.add(e.getFaultInfo().getFailedCustomers().get(0));
}
}
if (failed.size() > 0) {
ValidationFault fault = new ValidationFault();
fault.getFailedCustomers().addAll(failed);
throw new ValidationFault_Exception("Validation errors on bulk registering customers", fault);
}
return registered;
}
use of org.jboss.test.ws.jaxws.benchmark.test.complex.types.ValidationFault in project jbossws-cxf by jbossws.
the class RegistrationServiceImpl method register.
public long register(Customer customer, Object when) throws AlreadyRegisteredFault_Exception, ValidationFault_Exception {
Name name = customer.getName();
if (name == null) {
ValidationFault fault = new ValidationFault();
fault.getFailedCustomers().add(customer.getId());
throw new ValidationFault_Exception("No name!", fault);
}
for (Customer c : customer.getReferredCustomers()) {
log.trace("Refered customer: " + c.getName());
}
log.trace("registering customer: " + customer);
return customer.getId();
}
Aggregations