Search in sources :

Example 21 with LoggingFeature

use of org.apache.cxf.ext.logging.LoggingFeature in project syncope by apache.

the class SyncopeClientFactoryBean method defaultRestClientFactoryBean.

protected JAXRSClientFactoryBean defaultRestClientFactoryBean() {
    JAXRSClientFactoryBean defaultRestClientFactoryBean = new JAXRSClientFactoryBean();
    defaultRestClientFactoryBean.setHeaders(new HashMap<>());
    if (StringUtils.isBlank(address)) {
        throw new IllegalArgumentException("Property 'address' is missing");
    }
    defaultRestClientFactoryBean.setAddress(address);
    if (StringUtils.isNotBlank(domain)) {
        defaultRestClientFactoryBean.getHeaders().put(RESTHeaders.DOMAIN, Collections.singletonList(domain));
    }
    defaultRestClientFactoryBean.setThreadSafe(true);
    defaultRestClientFactoryBean.setInheritHeaders(true);
    List<Feature> features = new ArrayList<>();
    features.add(new LoggingFeature());
    defaultRestClientFactoryBean.setFeatures(features);
    List<Object> providers = new ArrayList<>(4);
    providers.add(new DateParamConverterProvider());
    providers.add(getJaxbProvider());
    providers.add(getJsonProvider());
    providers.add(getExceptionMapper());
    defaultRestClientFactoryBean.setProviders(providers);
    return defaultRestClientFactoryBean;
}
Also used : DateParamConverterProvider(org.apache.syncope.common.rest.api.DateParamConverterProvider) JAXRSClientFactoryBean(org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean) LoggingFeature(org.apache.cxf.ext.logging.LoggingFeature) ArrayList(java.util.ArrayList) Feature(org.apache.cxf.feature.Feature) LoggingFeature(org.apache.cxf.ext.logging.LoggingFeature)

Aggregations

LoggingFeature (org.apache.cxf.ext.logging.LoggingFeature)21 Test (org.junit.Test)13 SOAPFaultException (javax.xml.ws.soap.SOAPFaultException)4 WebClient (org.apache.cxf.jaxrs.client.WebClient)4 URL (java.net.URL)3 Endpoint (javax.xml.ws.Endpoint)3 Client (org.apache.cxf.endpoint.Client)3 Server (org.apache.cxf.endpoint.Server)3 LogEvent (org.apache.cxf.ext.logging.event.LogEvent)3 BeforeClass (org.junit.BeforeClass)3 Closeable (java.io.Closeable)2 InputStream (java.io.InputStream)2 ArrayList (java.util.ArrayList)2 QName (javax.xml.namespace.QName)2 BindingProvider (javax.xml.ws.BindingProvider)2 SpringBusFactory (org.apache.cxf.bus.spring.SpringBusFactory)2 AbstractJaxWsTest (org.apache.cxf.jaxws.AbstractJaxWsTest)2 JaxWsServerFactoryBean (org.apache.cxf.jaxws.JaxWsServerFactoryBean)2 AddNumberImpl (org.apache.cxf.systest.ws.addr_fromjava.client.AddNumberImpl)2 AddNumbersException_Exception (org.apache.cxf.systest.ws.addr_fromjava.client.AddNumbersException_Exception)2