use of org.springframework.ws.client.support.interceptor.ClientInterceptor 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;
}
use of org.springframework.ws.client.support.interceptor.ClientInterceptor in project spring-integration by spring-projects.
the class WebServiceOutboundGatewayParserTests method simpleGatewayWithCustomInterceptor.
@Test
public void simpleGatewayWithCustomInterceptor() {
AbstractEndpoint endpoint = this.context.getBean("gatewayWithCustomInterceptor", AbstractEndpoint.class);
assertEquals(EventDrivenConsumer.class, endpoint.getClass());
Object gateway = new DirectFieldAccessor(endpoint).getPropertyValue("handler");
assertEquals(SimpleWebServiceOutboundGateway.class, gateway.getClass());
DirectFieldAccessor accessor = new DirectFieldAccessor(gateway);
accessor = new DirectFieldAccessor(accessor.getPropertyValue("webServiceTemplate"));
ClientInterceptor interceptor = context.getBean("interceptor", ClientInterceptor.class);
assertEquals(interceptor, ((ClientInterceptor[]) accessor.getPropertyValue("interceptors"))[0]);
}
use of org.springframework.ws.client.support.interceptor.ClientInterceptor in project camel by apache.
the class ProducerWss4JSecurityHeaderTest method setRemoveHeaders.
private void setRemoveHeaders(boolean isRemoved) {
ClientInterceptor[] clientInterceptors = webServiceTemplate.getInterceptors();
for (int i = 0; i < clientInterceptors.length; i++) {
if (clientInterceptors[i] instanceof Wss4jSecurityInterceptor) {
Wss4jSecurityInterceptor wss4jSampleInterceptor = (Wss4jSecurityInterceptor) clientInterceptors[i];
wss4jSampleInterceptor.setRemoveSecurityHeader(isRemoved);
}
}
}
use of org.springframework.ws.client.support.interceptor.ClientInterceptor in project spring-integration by spring-projects.
the class WebServiceOutboundGatewayParserTests method simpleGatewayWithCustomInterceptorList.
@Test
public void simpleGatewayWithCustomInterceptorList() {
AbstractEndpoint endpoint = this.context.getBean("gatewayWithCustomInterceptorList", AbstractEndpoint.class);
assertEquals(EventDrivenConsumer.class, endpoint.getClass());
Object gateway = new DirectFieldAccessor(endpoint).getPropertyValue("handler");
assertEquals(SimpleWebServiceOutboundGateway.class, gateway.getClass());
DirectFieldAccessor accessor = new DirectFieldAccessor(gateway);
accessor = new DirectFieldAccessor(accessor.getPropertyValue("webServiceTemplate"));
ClientInterceptor interceptor = context.getBean("interceptor", ClientInterceptor.class);
assertEquals(interceptor, ((ClientInterceptor[]) accessor.getPropertyValue("interceptors"))[0]);
assertEquals("Wrong number of interceptors ", 2, ((ClientInterceptor[]) accessor.getPropertyValue("interceptors")).length);
}
Aggregations