Package org.apache.cxf.customer

Examples of org.apache.cxf.customer.Customer


   
    @Resource
    private WebServiceContext context;
   
    public CustomerService() {
        Customer customer = createCustomer();
        customers.put(customer.getId(), customer);
    }
View Full Code Here


    @HttpResource(location = "/customers/{id}")
    @WebMethod
    @WebResult(name = "customer")
    public Customer getCustomer(@WebParam(name = "getCustomer") GetCustomer getCustomer)
        throws CustomerNotFoundFault {
        Customer c = customers.get(getCustomer.getId());
        if (c == null) {
            CustomerNotFoundDetails details = new CustomerNotFoundDetails();
            details.setId(getCustomer.getId());
            throw new CustomerNotFoundFault(details);
        }
View Full Code Here

    public void deleteCustomer(long id) {
        customers.remove(id);
    }

    final Customer createCustomer() {
        Customer c = new Customer();
        c.setName("Dan Diephouse");
        c.setId(123);
        return c;
    }
View Full Code Here

public class CustomerService {
    long currentId = 1;
    Map<Long, Customer> customers = new HashMap<Long, Customer>();

    public CustomerService() {
        Customer customer = createCustomer();
        customers.put(customer.getId(), customer);
    }
View Full Code Here

    public void deleteCustomer(String id) {
        customers.remove(new Long(id));
    }

    final Customer createCustomer() {
        Customer c = new Customer();
        c.setName("Dan Diephouse");
        c.setId(123);
        return c;
    }
View Full Code Here

        Object[] objects = client.invoke(new QName("http://cxf.apache.org/jra", "getCustomers"),
                                         new GetCustomers());
        assertNotNull(objects);
       
        Customers c = (Customers) objects[0];
        Customer customer = c.getCustomer().iterator().next();
        assertEquals("Dan Diephouse", customer.getName());
       
        GetCustomer getCustomer = new GetCustomer();
        getCustomer.setId(customer.getId());
        objects = client.invoke(new QName("http://cxf.apache.org/jra", "getCustomer"), getCustomer);
       
        customer = (Customer) objects[0];
        assertEquals("Dan Diephouse", customer.getName());
//       
//        objects = client.invoke(new QName("http://cxf.apache.org/jra", "deleteCustomer"),
//        customer.getId());
//        assertTrue(objects == null || objects.length == 0);
//       
View Full Code Here

   
    @Resource
    private WebServiceContext context;
   
    public CustomerService() {
        Customer customer = createCustomer();
        customers.put(customer.getId(), customer);
    }
View Full Code Here

    @Get
    @HttpResource(location = "/customers/{id}")
    @WebMethod
    public Customer getCustomer(@WebParam(name = "GetCustomer") GetCustomer getCustomer)
        throws CustomerNotFoundFault {
        Customer c = customers.get(getCustomer.getId());
        if (c == null) {
            CustomerNotFoundDetails details = new CustomerNotFoundDetails();
            details.setId(getCustomer.getId());
            throw new CustomerNotFoundFault(details);
        }
View Full Code Here

    public void deleteCustomer(long id) {
        customers.remove(id);
    }

    final Customer createCustomer() {
        Customer c = new Customer();
        c.setName("Dan Diephouse");
        c.setId(123);
        return c;
    }
View Full Code Here

        Object[] objects = client.invoke(new QName("http://cxf.apache.org/jra", "getCustomers"),
                                         new GetCustomers());
        assertNotNull(objects);
       
        Customers c = (Customers) objects[0];
        Customer customer = c.getCustomer().iterator().next();
        assertEquals("Dan Diephouse", customer.getName());
       
        GetCustomer getCustomer = new GetCustomer();
        getCustomer.setId(customer.getId());
        objects = client.invoke(new QName("http://cxf.apache.org/jra", "getCustomer"), getCustomer);
       
        customer = (Customer) objects[0];
        assertEquals("Dan Diephouse", customer.getName());
//       
//        objects = client.invoke(new QName("http://cxf.apache.org/jra", "deleteCustomer"),
//        customer.getId());
//        assertTrue(objects == null || objects.length == 0);
//       
View Full Code Here

TOP

Related Classes of org.apache.cxf.customer.Customer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.