Posts

Showing posts from January 28, 2019

How to make cxf jax-rs response.readEntity as generic

Image
1 The below code is working fine. I need to reuse this methods for all requests. How to make it as generics? public class ApiResponse { } public class QuoteRespWrapper extends ApiResponse{ private String responseType; private QuoteRespValue responseValue; } public class PolicyRespWrapper extends ApiResponse{ private String responseType; private PolicyRespValue responseValue; } public QuoteRespWrapper callService(String endPoint, String payload, Class<? extends ApiResponse> respClass) throws Exception { private static List<JacksonJsonProvider> providerList = singletonList(JacksonConfig.jacksonJsonProvider()); String userName="user1"; String password="password1"; WebClient client = WebClient.create(endPoint, providerList, userName