}
if (webServiceFeatureAnnotations.size() > 0) {
if (javax.xml.ws.Service.class.isAssignableFrom(webServiceRefType)) {
log.warn("In current JAX-WS spec, no standard web service feature is supported on service creation, " + webServiceFeatureAnnotations + " are ignored");
} else {
PortComponentRef portComponentRef = getPortComponentRef(serviceRef, webServiceRefType.getName());
for (Annotation webServiceFeatureAnnotation : webServiceFeatureAnnotations) {
Class<? extends Annotation> webServiceFeatureAnnotationType = webServiceFeatureAnnotation.annotationType();
if (webServiceFeatureAnnotationType == MTOM.class) {
MTOM mtom = (MTOM) webServiceFeatureAnnotation;
if (portComponentRef.getMtomThreshold() == null) {
portComponentRef.setMtomThreshold(mtom.threshold());
}
if (portComponentRef.getEnableMtom() == null) {
portComponentRef.setEnableMtom(mtom.enabled());
}
} else if (webServiceFeatureAnnotationType == javax.xml.ws.soap.Addressing.class) {
javax.xml.ws.soap.Addressing addressingAnnotation = (javax.xml.ws.soap.Addressing) webServiceFeatureAnnotation;
Addressing addressing = portComponentRef.getAddressing();
if (addressing == null) {
addressing = new Addressing();
addressing.setEnabled(addressingAnnotation.enabled());
addressing.setRequired(addressingAnnotation.required());
addressing.setResponses(AddressingResponses.valueOf(addressingAnnotation.responses().toString()));
portComponentRef.setAddressing(addressing);
} else {
if (addressing.getEnabled() == null) {
addressing.setEnabled(addressingAnnotation.enabled());
}
if (addressing.getRequired() == null) {
addressing.setRequired(addressingAnnotation.required());
}
if (addressing.getResponses() == null) {
addressing.setResponses(AddressingResponses.valueOf(addressingAnnotation.responses().toString()));
}
}
} else if (webServiceFeatureAnnotationType == RespectBinding.class) {
RespectBinding respectBinding = (RespectBinding) webServiceFeatureAnnotation;
if (portComponentRef.getRespectBinding() == null) {
org.apache.openejb.jee.RespectBinding respectBindingValue = new org.apache.openejb.jee.RespectBinding();
respectBindingValue.setEnabled(respectBinding.enabled());
portComponentRef.setRespectBinding(respectBindingValue);
}
} else {
log.warn("Unsupport web service feature annotation " + webServiceFeatureAnnotation + " on " + webServiceRefName);
}
}