Package org.example.customers

Examples of org.example.customers.CustomerService


        System.out.println("Using SOAP CustomerService");
       
        Service service = Service.create(CustomerServiceService.SERVICE);
        service.addPort(CustomerServiceService.CustomerServicePort, SOAPBinding.SOAP11HTTP_BINDING, address);

        CustomerService customerService = service.getPort(CustomerService.class);
               
        Customer customer = createCustomer("Barry");
        customerService.updateCustomer(customer);
        customer = customerService.getCustomerByName("Barry");
        printCustomerDetails(customer);
        try {
            customerService.getCustomerByName("Smith");
            throw new RuntimeException("Exception is expected");
        } catch (NoSuchCustomerException ex) {
            System.out.println("NoSuchCustomerException : Smith");
        }
    }
View Full Code Here


                return new NoSuchCustomerException();
            }

        });

        CustomerService customerService = JAXRSClientFactory
            .createFromModel("http://localhost:" + port + "/services/jaxrs", CustomerService.class,
                             "classpath:/data/model/CustomerService-jaxrs.xml", providers, null);

        System.out.println("Using RESTful CustomerService");

        Customer customer = createCustomer("Smith");
        customerService.updateCustomer(customer);

        customer = customerService.getCustomerByName("Smith");
        printCustomerDetails(customer);

        customer = customerService.getCustomerByName("Barry");
        if (customer != null) {
            throw new RuntimeException("Barry should not be found");
        }
        System.out.println("Status : " + WebClient.client(customerService).getResponse().getStatus());

        try {
            customerService.getCustomerByName("John");
            throw new RuntimeException("Exception is expected");
        } catch (NoSuchCustomerException ex) {
            System.out.println("NoSuchCustomerException : John");
        }
    }
View Full Code Here

    public static void main(String args[]) throws Exception {
       
        Bus bus = BusFactory.getDefaultBus();
        System.out.println("Starting Server");
        CustomerService implementor = new CustomerServiceImpl();
        Endpoint.publish("http://localhost:8080/services/jaxws", implementor);

        JAXRSServerFactoryBean jaxrsFactory = new JAXRSServerFactoryBean();
        jaxrsFactory.setBus(bus);
        jaxrsFactory.setAddress("http://localhost:8080/services/jaxrs");
View Full Code Here

TOP

Related Classes of org.example.customers.CustomerService

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.