Search in sources :

Example 1 with CustomerNotFoundDetails

use of org.apache.cxf.customer.CustomerNotFoundDetails in project cxf by apache.

the class CustomerService method getCustomer.

@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);
    }
    return c;
}
Also used : Customer(org.apache.cxf.customer.Customer) CustomerNotFoundFault(org.apache.cxf.customer.CustomerNotFoundFault) CustomerNotFoundDetails(org.apache.cxf.customer.CustomerNotFoundDetails) WebMethod(javax.jws.WebMethod) WebResult(javax.jws.WebResult)

Aggregations

WebMethod (javax.jws.WebMethod)1 WebResult (javax.jws.WebResult)1 Customer (org.apache.cxf.customer.Customer)1 CustomerNotFoundDetails (org.apache.cxf.customer.CustomerNotFoundDetails)1 CustomerNotFoundFault (org.apache.cxf.customer.CustomerNotFoundFault)1