Search in sources :

Example 1 with PowerAuthServiceClient

use of io.getlime.security.powerauth.soap.spring.client.PowerAuthServiceClient in project powerauth-restful-integration by lime-company.

the class PowerAuthWebServiceConfiguration method powerAuthClient.

/**
 * Prepare a correctly configured PowerAuthServiceClient instance with the service
 * URL specified using 'powerauth.service.url' server property.
 * @param marshaller JAXB marshaller
 * @return Correctly configured PowerAuthServiceClient instance with the service
 * URL specified using 'powerauth.service.url' server property
 */
@Bean
public PowerAuthServiceClient powerAuthClient(Jaxb2Marshaller marshaller) {
    PowerAuthServiceClient client = new PowerAuthServiceClient();
    client.setDefaultUri(powerAuthServiceUrl);
    client.setMarshaller(marshaller);
    client.setUnmarshaller(marshaller);
    // if there is a configuration with security credentials, add interceptor
    if (!clientToken.isEmpty()) {
        ClientInterceptor[] interceptors = new ClientInterceptor[] { securityInterceptor() };
        client.setInterceptors(interceptors);
    }
    return client;
}
Also used : ClientInterceptor(org.springframework.ws.client.support.interceptor.ClientInterceptor) PowerAuthServiceClient(io.getlime.security.powerauth.soap.spring.client.PowerAuthServiceClient) Bean(org.springframework.context.annotation.Bean)

Aggregations

PowerAuthServiceClient (io.getlime.security.powerauth.soap.spring.client.PowerAuthServiceClient)1 Bean (org.springframework.context.annotation.Bean)1 ClientInterceptor (org.springframework.ws.client.support.interceptor.ClientInterceptor)1