Search in sources :

Example 1 with BindingType

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;
    }
}
Also used : MTOM(javax.xml.ws.soap.MTOM) AddressingFeature(javax.xml.ws.soap.AddressingFeature) BindingType(javax.xml.ws.BindingType) MTOMFeature(javax.xml.ws.soap.MTOMFeature) RespectBindingFeature(javax.xml.ws.RespectBindingFeature) WebServiceFeature(javax.xml.ws.WebServiceFeature) ArrayList(java.util.ArrayList) RespectBinding(javax.xml.ws.RespectBinding) Addressing(javax.xml.ws.soap.Addressing)

Aggregations

ArrayList (java.util.ArrayList)1 BindingType (javax.xml.ws.BindingType)1 RespectBinding (javax.xml.ws.RespectBinding)1 RespectBindingFeature (javax.xml.ws.RespectBindingFeature)1 WebServiceFeature (javax.xml.ws.WebServiceFeature)1 Addressing (javax.xml.ws.soap.Addressing)1 AddressingFeature (javax.xml.ws.soap.AddressingFeature)1 MTOM (javax.xml.ws.soap.MTOM)1 MTOMFeature (javax.xml.ws.soap.MTOMFeature)1