本文整理汇总了Java中org.apache.camel.component.cxf.CxfEndpoint.setServiceClass方法的典型用法代码示例。如果您正苦于以下问题:Java CxfEndpoint.setServiceClass方法的具体用法?Java CxfEndpoint.setServiceClass怎么用?Java CxfEndpoint.setServiceClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.camel.component.cxf.CxfEndpoint
的用法示例。
在下文中一共展示了CxfEndpoint.setServiceClass方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createCxfProducerEndpoint
import org.apache.camel.component.cxf.CxfEndpoint; //导入方法依赖的package包/类
@Named("cxfProducerEndpoint")
@Produces
public CxfEndpoint createCxfProducerEndpoint() {
CxfComponent cxfProducerComponent = new CxfComponent(this.camelContext);
CxfEndpoint cxfProducerEndpoint = new CxfEndpoint(CXF_PRODUCER_ENDPOINT_ADDRESS, cxfProducerComponent);
cxfProducerEndpoint.setBeanId("cxfProducerEndpoint");
cxfProducerEndpoint.setServiceClass(org.wildfly.camel.examples.cxf.jaxws.GreetingService.class);
SSLContextParameters producerSslContextParameters = this.createProducerSSLContextParameters();
cxfProducerEndpoint.setSslContextParameters(producerSslContextParameters);
// Not for use in production
HostnameVerifier hostnameVerifier = new HostnameVerifier() {
@Override
public boolean verify(String hostname, SSLSession session) {
return true;
}
};
cxfProducerEndpoint.setHostnameVerifier(hostnameVerifier);
return cxfProducerEndpoint;
}
示例2: userServiceEndpoint
import org.apache.camel.component.cxf.CxfEndpoint; //导入方法依赖的package包/类
@Bean(name = "helloEndpoint")
public CxfEndpoint userServiceEndpoint() {
CxfEndpoint cxfEndpoint = new CxfEndpoint();
cxfEndpoint.setAddress("http://localhost:8888/services/hello");
cxfEndpoint.setServiceClass(HelloWorld.class);
LoggingInInterceptor loggingInInterceptor = new LoggingInInterceptor();
loggingInInterceptor.setPrettyLogging(true);
LoggingOutInterceptor loggingOutInterceptor = new LoggingOutInterceptor();
loggingOutInterceptor.setPrettyLogging(true);
cxfEndpoint.getOutInterceptors().add(loggingOutInterceptor);
cxfEndpoint.getInInterceptors().add(loggingInInterceptor);
cxfEndpoint.setDataFormat(DataFormat.POJO);
final Map<String, Object> properties = new HashMap<>();
properties.put("schema-validation-enabled", "true");
properties.put("bus.jmx.enabled", "true");
//properties.setProperty("faultStackTraceEnabled", "true");
//properties.setProperty("exceptionMessageCauseEnabled", "true");
//properties.setProperty("schema-validation-enabled", "false");
//properties.put("allowStreaming", true);
cxfEndpoint.configureProperties(properties);
return cxfEndpoint;
}
示例3: createCxfConsumerEndpoint
import org.apache.camel.component.cxf.CxfEndpoint; //导入方法依赖的package包/类
@Named("cxfConsumerEndpoint")
@Produces
public CxfEndpoint createCxfConsumerEndpoint() {
CxfComponent cxfConsumerComponent = new CxfComponent(this.camelContext);
CxfEndpoint cxfConsumerEndpoint = new CxfEndpoint(CXF_CONSUMER_ENDPOINT_ADDRESS, cxfConsumerComponent);
cxfConsumerEndpoint.setBeanId("cxfConsumerEndpoint");
cxfConsumerEndpoint.setServiceClass(org.wildfly.camel.examples.cxf.jaxws.GreetingService.class);
SSLContextParameters consumerSslContextParameters = this.createConsumerSSLContextParameters();
cxfConsumerEndpoint.setSslContextParameters(consumerSslContextParameters);
List<Interceptor<? extends Message>> inInterceptors = cxfConsumerEndpoint.getInInterceptors();
// Authentication
JAASLoginInterceptor jaasLoginInterceptor = new JAASLoginInterceptor();
jaasLoginInterceptor.setContextName(WILDFLY_SECURITY_DOMAIN_NAME);
jaasLoginInterceptor.setAllowAnonymous(false);
List<CallbackHandlerProvider> chp = Arrays.asList(new JBossCallbackHandlerTlsCert());
jaasLoginInterceptor.setCallbackHandlerProviders(chp);
inInterceptors.add(jaasLoginInterceptor);
// Authorization
SimpleAuthorizingInterceptor authorizingInterceptor = new SimpleAuthorizingInterceptor();
authorizingInterceptor.setAllowAnonymousUsers(false);
Map<String, String> rolesMap = new HashMap<>(1);
rolesMap.put("greet", "testRole");
authorizingInterceptor.setMethodRolesMap(rolesMap);
inInterceptors.add(authorizingInterceptor);
return cxfConsumerEndpoint;
}
示例4: createCxfConsumer
import org.apache.camel.component.cxf.CxfEndpoint; //导入方法依赖的package包/类
@Named("cxfConsumer")
@Produces
public CxfEndpoint createCxfConsumer() {
CxfComponent cxfComponent = new CxfComponent(this.context);
CxfEndpoint cxfFromEndpoint = new CxfEndpoint("http://localhost:8080/webservices/greeting-cdi-xml", cxfComponent);
cxfFromEndpoint.setServiceClass(GreetingService.class);
return cxfFromEndpoint;
}
示例5: createCxfProducer
import org.apache.camel.component.cxf.CxfEndpoint; //导入方法依赖的package包/类
@Named("cxfProducer")
@Produces
public CxfEndpoint createCxfProducer() {
CxfComponent cxfComponent = new CxfComponent(this.context);
CxfEndpoint cxfToEndpoint = new CxfEndpoint("http://localhost:8080/webservices/greeting-cdi-xml", cxfComponent);
cxfToEndpoint.setServiceClass(GreetingService.class);
return cxfToEndpoint;
}
示例6: configure
import org.apache.camel.component.cxf.CxfEndpoint; //导入方法依赖的package包/类
@Override
public void configure() throws Exception {
// Set system properties for use with Camel property placeholders for running the example tests.
System.setProperty("routerPort", String.valueOf(AvailablePortFinder.getNextAvailable()));
System.setProperty("servicePort", String.valueOf(AvailablePortFinder.getNextAvailable()));
CxfComponent cxfComponent = new CxfComponent(getContext());
CxfEndpoint serviceEndpoint = new CxfEndpoint(SERVICE_ADDRESS, cxfComponent);
serviceEndpoint.setServiceClass(Greeter.class);
// Here we just pass the exception back, don't need to use errorHandler
errorHandler(noErrorHandler());
from(ROUTER_ENDPOINT_URI).to(serviceEndpoint);
}
示例7: wsEndpoint
import org.apache.camel.component.cxf.CxfEndpoint; //导入方法依赖的package包/类
@Bean(name = "wsEndpoint")
public CxfEndpoint wsEndpoint() throws ClassNotFoundException {
CxfEndpoint cxfEndpoint = new CxfEndpoint();
cxfEndpoint.setAddress("http://localhost:8888/services/person");
cxfEndpoint.setServiceClass("pl.java.scalatech.spring_camel.service.impl.PersonServiceImpl");
cxfEndpoint.setLoggingFeatureEnabled(true);
return cxfEndpoint;
}
示例8: configureCamelContext
import org.apache.camel.component.cxf.CxfEndpoint; //导入方法依赖的package包/类
private CamelContext configureCamelContext(String password) throws Exception {
CamelContext camelctx = new DefaultCamelContext();
CxfComponent component = new CxfComponent(camelctx);
CxfEndpoint consumerEndpoint = new CxfEndpoint("http://localhost:8080/webservices/greeting", component);
consumerEndpoint.setServiceClass(Endpoint.class);
List<Interceptor<? extends Message>> inInterceptors = consumerEndpoint.getInInterceptors();
JAASLoginInterceptor interceptor = new JAASLoginInterceptor();
interceptor.setContextName("other");
inInterceptors.add(interceptor);
CxfEndpoint producerEndpoint = new CxfEndpoint("http://localhost:8080/webservices/greeting", component);
producerEndpoint.setServiceClass(Endpoint.class);
producerEndpoint.setUsername("user1");
producerEndpoint.setPassword(password);
Map<String, Object> properties = producerEndpoint.getProperties();
if (properties == null) {
producerEndpoint.setProperties(new HashMap<>());
}
camelctx.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
from("direct:start")
.to(producerEndpoint);
from(consumerEndpoint)
.process(exchange -> {
Object[] args = exchange.getIn().getBody(Object[].class);
exchange.getOut().setBody("Hello " + args[0]);
});
}
});
return camelctx;
}
示例9: testCXFInterceptor
import org.apache.camel.component.cxf.CxfEndpoint; //导入方法依赖的package包/类
@Test
public void testCXFInterceptor() throws Exception {
CountDownLatch latch = new CountDownLatch(1);
CamelContext camelctx = new DefaultCamelContext();
CxfComponent component = new CxfComponent(camelctx);
CxfEndpoint cxfEndpoint = new CxfEndpoint("http://localhost:8080/EndpointService/EndpointPort", component);
cxfEndpoint.setServiceClass(Endpoint.class);
List<Interceptor<? extends Message>> inInterceptors = cxfEndpoint.getInInterceptors();
inInterceptors.add(new CountDownInterceptor(latch));
camelctx.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
from(cxfEndpoint)
.setBody(constant("Hello ${body}"));
}
});
camelctx.start();
try {
QName qname = new QName("http://wildfly.camel.test.cxf", "EndpointService");
Service service = Service.create(new URL("http://localhost:8080/EndpointService/EndpointPort?wsdl"), qname);
Endpoint endpoint = service.getPort(Endpoint.class);
endpoint.echo("Kermit");
Assert.assertTrue("Gave up waiting for CXF interceptor handleMessage", latch.await(5, TimeUnit.SECONDS));
} finally {
camelctx.stop();
}
}
示例10: createCxfEndpoint
import org.apache.camel.component.cxf.CxfEndpoint; //导入方法依赖的package包/类
private CxfEndpoint createCxfEndpoint(String endpointUrl, CxfComponent component) throws Exception {
CxfEndpoint cxfEndpoint = new CxfEndpoint(endpointUrl, component);
cxfEndpoint.setServiceClass(Endpoint.class.getName());
return cxfEndpoint;
}