use of javax.xml.ws.BindingType in project cxf by apache.
the class JaxWsServiceFactoryBean method loadWSFeatureAnnotation.
private void loadWSFeatureAnnotation(Class<?> serviceClass, Class<?> implementorClass) {
List<WebServiceFeature> features = new ArrayList<>();
MTOM mtom = implInfo.getImplementorClass().getAnnotation(MTOM.class);
if (mtom == null && serviceClass != null) {
mtom = serviceClass.getAnnotation(MTOM.class);
}
if (mtom != null) {
features.add(new MTOMFeature(mtom.enabled(), mtom.threshold()));
} else {
// deprecated way to set mtom
BindingType bt = implInfo.getImplementorClass().getAnnotation(BindingType.class);
if (bt != null && (SOAPBinding.SOAP11HTTP_MTOM_BINDING.equals(bt.value()) || SOAPBinding.SOAP12HTTP_MTOM_BINDING.equals(bt.value()))) {
features.add(new MTOMFeature(true));
}
}
Addressing addressing = null;
if (implementorClass != null) {
addressing = implementorClass.getAnnotation(Addressing.class);
}
if (addressing == null && serviceClass != null) {
addressing = serviceClass.getAnnotation(Addressing.class);
}
if (addressing != null) {
features.add(new AddressingFeature(addressing.enabled(), addressing.required(), addressing.responses()));
}
RespectBinding respectBinding = implInfo.getImplementorClass().getAnnotation(RespectBinding.class);
if (respectBinding == null && serviceClass != null) {
respectBinding = serviceClass.getAnnotation(RespectBinding.class);
}
if (respectBinding != null) {
features.add(new RespectBindingFeature(respectBinding.enabled()));
}
if (!features.isEmpty()) {
wsFeatures = features;
if (setWsFeatures != null) {
wsFeatures.addAll(setWsFeatures);
}
} else {
wsFeatures = setWsFeatures;
}
}
Aggregations