use of org.apache.cxf.jaxws.JaxWsProxyFactoryBean in project camel by apache.
the class JaxWSCamelTestSupport method getSampleWSAsyncWithCXFAPI.
public SampleWSAsync getSampleWSAsyncWithCXFAPI(String camelEndpoint) {
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setAddress("camel://" + camelEndpoint);
factory.setServiceClass(SampleWSAsync.class);
factory.setBus(bus);
return factory.create(SampleWSAsync.class);
}
use of org.apache.cxf.jaxws.JaxWsProxyFactoryBean in project ddf by codice.
the class SecureProxyServiceFactoryImpl method createSecureClientFactory.
private <ProxyServiceType> ProxyServiceType createSecureClientFactory(WebServiceProperties<ProxyServiceType> wsp, SecurityToken token) throws UnsupportedOperationException {
JaxWsProxyFactoryBean clientFactory = new JaxWsProxyFactoryBean();
boolean populateFromClass = unavailableWsdls.contains(wsp.endpointWsdlURL);
if (populateFromClass) {
LOGGER.debug("Using service class to create client rather than WSDL.");
}
clientFactory.getClientFactoryBean().getServiceFactory().setPopulateFromClass(populateFromClass);
LOGGER.debug("Configuring client proxy properties");
configureProxyFactoryProperties(clientFactory, token, wsp);
clientFactory.getOutInterceptors().add(new TokenPassThroughInterceptor());
ProxyServiceType proxyServiceType;
try {
proxyServiceType = clientFactory.create(wsp.serviceClass);
} catch (ServiceConstructionException e) {
LOGGER.debug("Unable to use WSDL to build client. Attempting to use service class.", e);
unavailableWsdls.add(wsp.endpointWsdlURL);
clientFactory.getClientFactoryBean().getServiceFactory().setPopulateFromClass(true);
proxyServiceType = clientFactory.create(wsp.serviceClass);
}
return proxyServiceType;
}
use of org.apache.cxf.jaxws.JaxWsProxyFactoryBean in project cxf by apache.
the class BraveTracingTest method createJaxWsService.
private BookStoreService createJaxWsService(final Map<String, List<String>> headers, final Configurator configurator) throws MalformedURLException {
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.getOutInterceptors().add(new LoggingOutInterceptor());
factory.getInInterceptors().add(new LoggingInInterceptor());
factory.setServiceClass(BookStoreService.class);
factory.setAddress("http://localhost:" + PORT + "/BookStore");
if (configurator != null) {
configurator.configure(factory);
}
final BookStoreService service = (BookStoreService) factory.create();
final Client proxy = ClientProxy.getClient(service);
proxy.getRequestContext().put(Message.PROTOCOL_HEADERS, headers);
return service;
}
use of org.apache.cxf.jaxws.JaxWsProxyFactoryBean in project cxf by apache.
the class HTraceTracingTest method testThatProvidedSpanIsNotClosedWhenActive.
@Test
public void testThatProvidedSpanIsNotClosedWhenActive() throws MalformedURLException {
final Tracer tracer = createTracer();
final BookStoreService service = createJaxWsService(new Configurator() {
@Override
public void configure(final JaxWsProxyFactoryBean factory) {
factory.getOutInterceptors().add(new HTraceClientStartInterceptor(tracer));
factory.getInInterceptors().add(new HTraceClientStopInterceptor());
}
});
try (TraceScope scope = tracer.newScope("test span")) {
assertThat(service.getBooks().size(), equalTo(2));
assertThat(Tracer.getCurrentSpan(), not(nullValue()));
assertThat(TestSpanReceiver.getAllSpans().size(), equalTo(2));
assertThat(TestSpanReceiver.getAllSpans().get(0).getDescription(), equalTo("Get Books"));
assertThat(TestSpanReceiver.getAllSpans().get(0).getParents().length, equalTo(1));
assertThat(TestSpanReceiver.getAllSpans().get(1).getDescription(), equalTo("POST /BookStore"));
}
assertThat(TestSpanReceiver.getAllSpans().size(), equalTo(3));
assertThat(TestSpanReceiver.getAllSpans().get(2).getDescription(), equalTo("test span"));
final Map<String, List<String>> response = getResponseHeaders(service);
assertThat(response.get(TracerHeaders.DEFAULT_HEADER_SPAN_ID), not(nullValue()));
}
use of org.apache.cxf.jaxws.JaxWsProxyFactoryBean in project cxf by apache.
the class OpenTracingTracingTest method createJaxWsService.
private BookStoreService createJaxWsService(final Map<String, List<String>> headers, final Configurator configurator) throws MalformedURLException {
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.getOutInterceptors().add(new LoggingOutInterceptor());
factory.getInInterceptors().add(new LoggingInInterceptor());
factory.setServiceClass(BookStoreService.class);
factory.setAddress("http://localhost:" + PORT + "/BookStore");
if (configurator != null) {
configurator.configure(factory);
}
final BookStoreService service = (BookStoreService) factory.create();
final Client proxy = ClientProxy.getClient(service);
proxy.getRequestContext().put(Message.PROTOCOL_HEADERS, headers);
return service;
}
Aggregations