Search in sources :

Example 6 with Customer

use of org.jboss.test.ws.jaxws.benchmark.test.complex.types.Customer in project jbossws-cxf by jbossws.

the class ComplexTest method getFredJackson.

private Customer getFredJackson() {
    Name name = new Name();
    name.setFirstName("Fred");
    name.setMiddleName("Jones");
    name.setLastName("Jackson");
    Address address = new Address();
    address.setCity("Atlanta");
    address.setState("Georgia");
    address.setZip("53717");
    address.setStreet("Yet Another Peach Tree St.");
    PhoneNumber number1 = new PhoneNumber();
    number1.setAreaCode("123");
    number1.setExchange("456");
    number1.setLine("7890");
    PhoneNumber number2 = new PhoneNumber();
    number1.setAreaCode("333");
    number1.setExchange("222");
    number1.setLine("1234");
    Customer customer = new Customer();
    customer.setId(123);
    customer.setName(name);
    customer.setAddress(address);
    customer.getContactNumbers().add(number1);
    customer.getContactNumbers().add(number2);
    return customer;
}
Also used : Address(org.jboss.test.ws.jaxws.benchmark.test.complex.types.Address) InvoiceCustomer(org.jboss.test.ws.jaxws.benchmark.test.complex.types.InvoiceCustomer) Customer(org.jboss.test.ws.jaxws.benchmark.test.complex.types.Customer) PhoneNumber(org.jboss.test.ws.jaxws.benchmark.test.complex.types.PhoneNumber) Name(org.jboss.test.ws.jaxws.benchmark.test.complex.types.Name) QName(javax.xml.namespace.QName)

Example 7 with Customer

use of org.jboss.test.ws.jaxws.benchmark.test.complex.types.Customer 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;
}
Also used : ValidationFault_Exception(org.jboss.test.ws.jaxws.benchmark.test.complex.types.ValidationFault_Exception) ValidationFault(org.jboss.test.ws.jaxws.benchmark.test.complex.types.ValidationFault) InvoiceCustomer(org.jboss.test.ws.jaxws.benchmark.test.complex.types.InvoiceCustomer) Customer(org.jboss.test.ws.jaxws.benchmark.test.complex.types.Customer) ArrayList(java.util.ArrayList)

Example 8 with Customer

use of org.jboss.test.ws.jaxws.benchmark.test.complex.types.Customer in project jbossws-cxf by jbossws.

the class JAXWSBenchmarkComplex method getJohnDoe.

private Customer getJohnDoe(int r) {
    Name name = new Name();
    name.setFirstName("John");
    name.setLastName("Doe");
    Address address = new Address();
    address.setCity("New York");
    address.setState("New York");
    address.setZip("10010");
    address.setStreet("Park Street");
    PhoneNumber number1 = new PhoneNumber();
    number1.setAreaCode("555");
    number1.setExchange("867");
    number1.setLine("5309");
    Customer customer = new Customer();
    customer.setName(name);
    customer.setAddress(address);
    customer.getContactNumbers().add(number1);
    customer.setId(r);
    return customer;
}
Also used : Address(org.jboss.test.ws.jaxws.benchmark.test.complex.types.Address) InvoiceCustomer(org.jboss.test.ws.jaxws.benchmark.test.complex.types.InvoiceCustomer) Customer(org.jboss.test.ws.jaxws.benchmark.test.complex.types.Customer) PhoneNumber(org.jboss.test.ws.jaxws.benchmark.test.complex.types.PhoneNumber) Name(org.jboss.test.ws.jaxws.benchmark.test.complex.types.Name) QName(javax.xml.namespace.QName)

Example 9 with Customer

use of org.jboss.test.ws.jaxws.benchmark.test.complex.types.Customer in project jbossws-cxf by jbossws.

the class ComplexTest method getJohnDoe.

private Customer getJohnDoe() {
    Name name = new Name();
    name.setFirstName("John");
    name.setLastName("Doe");
    Address address = new Address();
    address.setCity("New York");
    address.setState("New York");
    address.setZip("10010");
    address.setStreet("Park Street");
    PhoneNumber number1 = new PhoneNumber();
    number1.setAreaCode("555");
    number1.setExchange("867");
    number1.setLine("5309");
    Customer customer = new Customer();
    customer.setName(name);
    customer.setAddress(address);
    customer.getContactNumbers().add(number1);
    customer.setId(124);
    return customer;
}
Also used : Address(org.jboss.test.ws.jaxws.benchmark.test.complex.types.Address) InvoiceCustomer(org.jboss.test.ws.jaxws.benchmark.test.complex.types.InvoiceCustomer) Customer(org.jboss.test.ws.jaxws.benchmark.test.complex.types.Customer) PhoneNumber(org.jboss.test.ws.jaxws.benchmark.test.complex.types.PhoneNumber) Name(org.jboss.test.ws.jaxws.benchmark.test.complex.types.Name) QName(javax.xml.namespace.QName)

Example 10 with Customer

use of org.jboss.test.ws.jaxws.benchmark.test.complex.types.Customer in project jbossws-cxf by jbossws.

the class ComplexTest method getInvalid.

private Customer getInvalid(long id) {
    Address address = new Address();
    address.setCity("New York");
    address.setState("New York");
    address.setZip("10010");
    address.setStreet("Park Street");
    PhoneNumber number1 = new PhoneNumber();
    number1.setAreaCode("555");
    number1.setExchange("867");
    number1.setLine("5309");
    Customer customer = new Customer();
    customer.setAddress(address);
    customer.getContactNumbers().add(number1);
    customer.setId(id);
    return customer;
}
Also used : Address(org.jboss.test.ws.jaxws.benchmark.test.complex.types.Address) InvoiceCustomer(org.jboss.test.ws.jaxws.benchmark.test.complex.types.InvoiceCustomer) Customer(org.jboss.test.ws.jaxws.benchmark.test.complex.types.Customer) PhoneNumber(org.jboss.test.ws.jaxws.benchmark.test.complex.types.PhoneNumber)

Aggregations

Customer (org.jboss.test.ws.jaxws.benchmark.test.complex.types.Customer)12 InvoiceCustomer (org.jboss.test.ws.jaxws.benchmark.test.complex.types.InvoiceCustomer)12 Address (org.jboss.test.ws.jaxws.benchmark.test.complex.types.Address)8 PhoneNumber (org.jboss.test.ws.jaxws.benchmark.test.complex.types.PhoneNumber)8 Name (org.jboss.test.ws.jaxws.benchmark.test.complex.types.Name)7 QName (javax.xml.namespace.QName)6 XMLGregorianCalendar (javax.xml.datatype.XMLGregorianCalendar)2 ValidationFault (org.jboss.test.ws.jaxws.benchmark.test.complex.types.ValidationFault)2 ValidationFault_Exception (org.jboss.test.ws.jaxws.benchmark.test.complex.types.ValidationFault_Exception)2 ArrayList (java.util.ArrayList)1