Search in sources :

Example 1 with WebServiceClient

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);
}
Also used : HTTPClient(core.framework.http.HTTPClient) RequestBeanMapper(core.framework.impl.web.bean.RequestBeanMapper) WebServiceInterfaceValidator(core.framework.impl.web.service.WebServiceInterfaceValidator) WebServiceClient(core.framework.impl.web.service.WebServiceClient)

Aggregations

HTTPClient (core.framework.http.HTTPClient)1 RequestBeanMapper (core.framework.impl.web.bean.RequestBeanMapper)1 WebServiceClient (core.framework.impl.web.service.WebServiceClient)1 WebServiceInterfaceValidator (core.framework.impl.web.service.WebServiceInterfaceValidator)1