use of org.apache.cxf.frontend.ServerFactoryBean in project camel by apache.
the class CxfConsumer method createServer.
protected Server createServer() throws Exception {
ServerFactoryBean svrBean = cxfEndpoint.createServerFactoryBean();
svrBean.setInvoker(new CxfConsumerInvoker(cxfEndpoint));
Server server = svrBean.create();
// Apply the server configurer if it is possible
if (cxfEndpoint.getCxfEndpointConfigurer() != null) {
cxfEndpoint.getCxfEndpointConfigurer().configureServer(server);
}
if (ObjectHelper.isNotEmpty(cxfEndpoint.getPublishedEndpointUrl())) {
server.getEndpoint().getEndpointInfo().setProperty("publishedEndpointUrl", cxfEndpoint.getPublishedEndpointUrl());
}
return server;
}
use of org.apache.cxf.frontend.ServerFactoryBean in project camel by apache.
the class CxfSpringEndpoint method createServerFactoryBean.
/**
* Create a service factory bean
*/
@Override
ServerFactoryBean createServerFactoryBean() throws Exception {
// get service class
Class<?> cls = getSEIClass();
if (getWsdlURL() == null && cls == null) {
// no WSDL and serviceClass specified, set our default serviceClass
if (getDataFormat().equals(DataFormat.PAYLOAD)) {
setServiceClass(org.apache.camel.component.cxf.DefaultPayloadProviderSEI.class.getName());
}
cls = getServiceClass();
}
// create server factory bean
// Shouldn't use CxfEndpointUtils.getServerFactoryBean(cls) as it is for
// CxfSoapComponent
ServerFactoryBean answer = null;
if (cls == null) {
if (!getDataFormat().equals(DataFormat.POJO)) {
answer = new JaxWsServerFactoryBean(new WSDLServiceFactoryBean()) {
{
doInit = false;
}
};
cls = Provider.class;
} else {
ObjectHelper.notNull(cls, CxfConstants.SERVICE_CLASS);
}
} else if (CxfEndpointUtils.hasWebServiceAnnotation(cls)) {
answer = new JaxWsServerFactoryBean();
} else {
answer = new ServerFactoryBean();
}
// setup server factory bean
setupServerFactoryBean(answer, cls);
// fill in values that have not been filled.
if (answer.getServiceName() == null && getServiceLocalName() != null) {
answer.setServiceName(new QName(getServiceNamespace(), getServiceLocalName()));
}
if (answer.getEndpointName() == null && getEndpointLocalName() != null) {
answer.setEndpointName(new QName(getEndpointNamespace(), getEndpointLocalName()));
}
if (cls == null) {
checkName(answer.getEndpointName(), "endpoint/port name");
checkName(answer.getServiceName(), "service name");
}
return answer;
}
use of org.apache.cxf.frontend.ServerFactoryBean in project camel by apache.
the class CxfSimpleRouterTest method startService.
@Before
public void startService() {
//start a service
ServerFactoryBean svrBean = new ServerFactoryBean();
svrBean.setAddress(getServiceAddress());
svrBean.setServiceClass(HelloService.class);
svrBean.setServiceBean(new HelloServiceImpl());
configureFactory(svrBean);
server = svrBean.create();
server.start();
}
use of org.apache.cxf.frontend.ServerFactoryBean in project camel by apache.
the class CxfMixedModeRouterTest method startService.
@BeforeClass
public static void startService() {
//start a service
ServerFactoryBean svrBean = new ServerFactoryBean();
svrBean.setAddress(SERVICE_ADDRESS);
svrBean.setServiceClass(HelloService.class);
svrBean.setServiceBean(new HelloServiceImpl());
server = svrBean.create();
server.start();
}
use of org.apache.cxf.frontend.ServerFactoryBean in project camel by apache.
the class FailOverFeatureTest method init.
@BeforeClass
public static void init() {
// publish a web-service
ServerFactoryBean factory = new ServerFactoryBean();
factory.setAddress(SERVICE_ADDRESS);
factory.setServiceBean(new HelloServiceImpl());
factory.create();
}
Aggregations