client = createClientForStreamMessage();
}
}
private Client createClientForStreamMessage() throws CamelException {
CxfClientFactoryBean cfb = new CxfClientFactoryBean();
Class serviceClass = null;
if (endpoint.isSpringContextEndpoint()) {
CxfEndpointBean cxfEndpointBean = endpoint.getCxfEndpointBean();
serviceClass = cxfEndpointBean.getServiceClass();
} else {
if (endpoint.getServiceClass() == null) {
throw new CamelException("serviceClass setting missing from CXF endpoint configuration");
}
try {
serviceClass = ClassLoaderUtils.loadClass(endpoint.getServiceClass(), this.getClass());
} catch (ClassNotFoundException e) {
throw new CamelException(e);
}
}
boolean jsr181Enabled = CxfEndpointUtils.hasWebServiceAnnotation(serviceClass);
cfb.setJSR181Enabled(jsr181Enabled);
dataFormat = CxfEndpointUtils.getDataFormat(endpoint);
List<AbstractFeature> features = new ArrayList<AbstractFeature>();
if (dataFormat.equals(DataFormat.MESSAGE)) {
features.add(new MessageDataFormatFeature());
// features.add(new LoggingFeature());
} else if (dataFormat.equals(DataFormat.PAYLOAD)) {
features.add(new PayLoadDataFormatFeature());
// features.add(new LoggingFeature());
}
cfb.setFeatures(features);
return createClientFromClientFactoryBean(cfb);
}