How to use a common common interface for Jax-WS?
public interface IGenericWebService<T extends Record> { @WebMethod public List<T> listAll(); }
How to make it work without overriding the method?
@WebService public interface IWCustomerService extends IGenericWebService<Customer>{ }
General implementation
public abstract class GenericWebService<T extends Record> implements IGenericWebService<T>{ protected static Log log = LogFactory.getLog(GenericWebService.class); }
Customer service
@WebService(endpointInterface="com.dev.bridge.iwservices.IWCustomerService") @Service public class WCustomerService extends GenericWebService<Customer> implements IWCustomerService{ @Autowired private ICustomerService customerService; public List<Customer> listAll() { try { return customerService.listAll(); } catch (CoreException e) { log.error(e.getMessage(), e); } return new ArrayList<Customer>(); } }
source share