use of core.framework.impl.web.service.WebServiceClient in project core-ng-project by neowu.
the class APIConfig method client.
public <T> APIClientConfig client(Class<T> serviceInterface, String serviceURL) {
logger.info("create api service client, interface={}, serviceURL={}", serviceInterface.getCanonicalName(), serviceURL);
RequestBeanMapper requestBeanMapper = context.httpServer.handler.requestBeanMapper;
new WebServiceInterfaceValidator(serviceInterface, requestBeanMapper, context.httpServer.handler.responseBeanTypeValidator).validate();
HTTPClient httpClient = httpClient();
WebServiceClient webServiceClient = new WebServiceClient(serviceURL, httpClient, requestBeanMapper, context.logManager);
T client = createWebServiceClient(serviceInterface, webServiceClient);
context.beanFactory.bind(serviceInterface, null, client);
return new APIClientConfig(webServiceClient);
}
Aggregations