Java Code Examples for javax.xml.ws.soap.MTOM

The following examples show how to use javax.xml.ws.soap.MTOM. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: tomee   Source File: WsDeployer.java    License: Apache License 2.0 5 votes vote down vote up
private void configMtomAnnotation(final Class<?> clazz, final PortComponent portComponent) {
    final MTOM mtom = clazz.getAnnotation(MTOM.class);
    if (mtom != null) {
        if (portComponent.getEnableMtom() == null) {
            portComponent.setEnableMtom(mtom.enabled());
        }
        if (portComponent.getMtomThreshold() == null) {
            portComponent.setMtomThreshold(mtom.threshold());
        }
    }
}
 
Example 2
Source Project: TencentKona-8   Source File: RuntimeModeler.java    License: GNU General Public License v2.0 4 votes vote down vote up
/**
   *
   * creates an instance of RunTimeModeler given a <code>sei</code> and <code>binding</code>
   * @param portClass The SEI class to be modeled.
   * @param serviceName The ServiceName to use instead of one calculated from the implementation class
   * @param wsdlPort {@link com.sun.xml.internal.ws.api.model.wsdl.WSDLPort}
   * @param features web service features
   */
/*public RuntimeModeler(@NotNull Class portClass, @NotNull QName serviceName, @NotNull WSDLPortImpl wsdlPort, @NotNull WebServiceFeature... features){
      this(portClass, serviceName, wsdlPort, wsdlPort.getBinding().getBindingId(), features);
  }*/

/*private RuntimeModeler(@NotNull Class portClass, @NotNull QName serviceName, WSDLPortImpl binding, BindingID bindingId, @NotNull WebServiceFeature... features) {
      this.portClass = portClass;
      this.serviceName = serviceName;
      this.binding = binding;
      this.bindingId = bindingId;
      this.features = features;
  }*/

  public RuntimeModeler(@NotNull DatabindingConfig config){
      this.portClass = (config.getEndpointClass() != null)? config.getEndpointClass() : config.getContractClass();
      this.serviceName = config.getMappingInfo().getServiceName();
      this.binding = config.getWsdlPort();
      this.classLoader = config.getClassLoader();
      this.portName = config.getMappingInfo().getPortName();
      this.config = config;
      this.wsBinding = config.getWSBinding();
      metadataReader = config.getMetadataReader();
      targetNamespace = config.getMappingInfo().getTargetNamespace();
      if (metadataReader == null) metadataReader = new ReflectAnnotationReader();
      if (wsBinding != null) {
          this.bindingId = wsBinding.getBindingId();
              if (config.getFeatures() != null) wsBinding.getFeatures().mergeFeatures(config.getFeatures(), false);
              if (binding != null) wsBinding.getFeatures().mergeFeatures(binding.getFeatures(), false);
              this.features = WebServiceFeatureList.toList(wsBinding.getFeatures());
      } else {
          this.bindingId = config.getMappingInfo().getBindingID();
          this.features = WebServiceFeatureList.toList(config.getFeatures());
          if (binding != null) bindingId = binding.getBinding().getBindingId();
          if (bindingId == null) bindingId = getDefaultBindingID();
          if (!features.contains(MTOMFeature.class)) {
              MTOM mtomAn = getAnnotation(portClass, MTOM.class);
              if (mtomAn != null) features.add(WebServiceFeatureList.getFeature(mtomAn));
          }
          if (!features.contains(com.oracle.webservices.internal.api.EnvelopeStyleFeature.class)) {
              com.oracle.webservices.internal.api.EnvelopeStyle es = getAnnotation(portClass, com.oracle.webservices.internal.api.EnvelopeStyle.class);
              if (es != null) features.add(WebServiceFeatureList.getFeature(es));
          }
          this.wsBinding = bindingId.createBinding(features);
      }
  }
 
Example 3
Source Project: TencentKona-8   Source File: XmlMTOM.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public Class<? extends Annotation> annotationType() {
    return MTOM.class;
}
 
Example 4
Source Project: jdk8u60   Source File: RuntimeModeler.java    License: GNU General Public License v2.0 4 votes vote down vote up
/**
   *
   * creates an instance of RunTimeModeler given a <code>sei</code> and <code>binding</code>
   * @param portClass The SEI class to be modeled.
   * @param serviceName The ServiceName to use instead of one calculated from the implementation class
   * @param wsdlPort {@link com.sun.xml.internal.ws.api.model.wsdl.WSDLPort}
   * @param features web service features
   */
/*public RuntimeModeler(@NotNull Class portClass, @NotNull QName serviceName, @NotNull WSDLPortImpl wsdlPort, @NotNull WebServiceFeature... features){
      this(portClass, serviceName, wsdlPort, wsdlPort.getBinding().getBindingId(), features);
  }*/

/*private RuntimeModeler(@NotNull Class portClass, @NotNull QName serviceName, WSDLPortImpl binding, BindingID bindingId, @NotNull WebServiceFeature... features) {
      this.portClass = portClass;
      this.serviceName = serviceName;
      this.binding = binding;
      this.bindingId = bindingId;
      this.features = features;
  }*/

  public RuntimeModeler(@NotNull DatabindingConfig config){
      this.portClass = (config.getEndpointClass() != null)? config.getEndpointClass() : config.getContractClass();
      this.serviceName = config.getMappingInfo().getServiceName();
      this.binding = config.getWsdlPort();
      this.classLoader = config.getClassLoader();
      this.portName = config.getMappingInfo().getPortName();
      this.config = config;
      this.wsBinding = config.getWSBinding();
      metadataReader = config.getMetadataReader();
      targetNamespace = config.getMappingInfo().getTargetNamespace();
      if (metadataReader == null) metadataReader = new ReflectAnnotationReader();
      if (wsBinding != null) {
          this.bindingId = wsBinding.getBindingId();
              if (config.getFeatures() != null) wsBinding.getFeatures().mergeFeatures(config.getFeatures(), false);
              if (binding != null) wsBinding.getFeatures().mergeFeatures(binding.getFeatures(), false);
              this.features = WebServiceFeatureList.toList(wsBinding.getFeatures());
      } else {
          this.bindingId = config.getMappingInfo().getBindingID();
          this.features = WebServiceFeatureList.toList(config.getFeatures());
          if (binding != null) bindingId = binding.getBinding().getBindingId();
          if (bindingId == null) bindingId = getDefaultBindingID();
          if (!features.contains(MTOMFeature.class)) {
              MTOM mtomAn = getAnnotation(portClass, MTOM.class);
              if (mtomAn != null) features.add(WebServiceFeatureList.getFeature(mtomAn));
          }
          if (!features.contains(com.oracle.webservices.internal.api.EnvelopeStyleFeature.class)) {
              com.oracle.webservices.internal.api.EnvelopeStyle es = getAnnotation(portClass, com.oracle.webservices.internal.api.EnvelopeStyle.class);
              if (es != null) features.add(WebServiceFeatureList.getFeature(es));
          }
          this.wsBinding = bindingId.createBinding(features);
      }
  }
 
Example 5
Source Project: jdk8u60   Source File: XmlMTOM.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public Class<? extends Annotation> annotationType() {
    return MTOM.class;
}
 
Example 6
Source Project: openjdk-jdk8u   Source File: RuntimeModeler.java    License: GNU General Public License v2.0 4 votes vote down vote up
/**
   *
   * creates an instance of RunTimeModeler given a <code>sei</code> and <code>binding</code>
   * @param portClass The SEI class to be modeled.
   * @param serviceName The ServiceName to use instead of one calculated from the implementation class
   * @param wsdlPort {@link com.sun.xml.internal.ws.api.model.wsdl.WSDLPort}
   * @param features web service features
   */
/*public RuntimeModeler(@NotNull Class portClass, @NotNull QName serviceName, @NotNull WSDLPortImpl wsdlPort, @NotNull WebServiceFeature... features){
      this(portClass, serviceName, wsdlPort, wsdlPort.getBinding().getBindingId(), features);
  }*/

/*private RuntimeModeler(@NotNull Class portClass, @NotNull QName serviceName, WSDLPortImpl binding, BindingID bindingId, @NotNull WebServiceFeature... features) {
      this.portClass = portClass;
      this.serviceName = serviceName;
      this.binding = binding;
      this.bindingId = bindingId;
      this.features = features;
  }*/

  public RuntimeModeler(@NotNull DatabindingConfig config){
      this.portClass = (config.getEndpointClass() != null)? config.getEndpointClass() : config.getContractClass();
      this.serviceName = config.getMappingInfo().getServiceName();
      this.binding = config.getWsdlPort();
      this.classLoader = config.getClassLoader();
      this.portName = config.getMappingInfo().getPortName();
      this.config = config;
      this.wsBinding = config.getWSBinding();
      metadataReader = config.getMetadataReader();
      targetNamespace = config.getMappingInfo().getTargetNamespace();
      if (metadataReader == null) metadataReader = new ReflectAnnotationReader();
      if (wsBinding != null) {
          this.bindingId = wsBinding.getBindingId();
              if (config.getFeatures() != null) wsBinding.getFeatures().mergeFeatures(config.getFeatures(), false);
              if (binding != null) wsBinding.getFeatures().mergeFeatures(binding.getFeatures(), false);
              this.features = WebServiceFeatureList.toList(wsBinding.getFeatures());
      } else {
          this.bindingId = config.getMappingInfo().getBindingID();
          this.features = WebServiceFeatureList.toList(config.getFeatures());
          if (binding != null) bindingId = binding.getBinding().getBindingId();
          if (bindingId == null) bindingId = getDefaultBindingID();
          if (!features.contains(MTOMFeature.class)) {
              MTOM mtomAn = getAnnotation(portClass, MTOM.class);
              if (mtomAn != null) features.add(WebServiceFeatureList.getFeature(mtomAn));
          }
          if (!features.contains(com.oracle.webservices.internal.api.EnvelopeStyleFeature.class)) {
              com.oracle.webservices.internal.api.EnvelopeStyle es = getAnnotation(portClass, com.oracle.webservices.internal.api.EnvelopeStyle.class);
              if (es != null) features.add(WebServiceFeatureList.getFeature(es));
          }
          this.wsBinding = bindingId.createBinding(features);
      }
  }
 
Example 7
Source Project: openjdk-jdk8u   Source File: XmlMTOM.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public Class<? extends Annotation> annotationType() {
    return MTOM.class;
}
 
Example 8
/**
   *
   * creates an instance of RunTimeModeler given a <code>sei</code> and <code>binding</code>
   * @param portClass The SEI class to be modeled.
   * @param serviceName The ServiceName to use instead of one calculated from the implementation class
   * @param wsdlPort {@link com.sun.xml.internal.ws.api.model.wsdl.WSDLPort}
   * @param features web service features
   */
/*public RuntimeModeler(@NotNull Class portClass, @NotNull QName serviceName, @NotNull WSDLPortImpl wsdlPort, @NotNull WebServiceFeature... features){
      this(portClass, serviceName, wsdlPort, wsdlPort.getBinding().getBindingId(), features);
  }*/

/*private RuntimeModeler(@NotNull Class portClass, @NotNull QName serviceName, WSDLPortImpl binding, BindingID bindingId, @NotNull WebServiceFeature... features) {
      this.portClass = portClass;
      this.serviceName = serviceName;
      this.binding = binding;
      this.bindingId = bindingId;
      this.features = features;
  }*/

  public RuntimeModeler(@NotNull DatabindingConfig config){
      this.portClass = (config.getEndpointClass() != null)? config.getEndpointClass() : config.getContractClass();
      this.serviceName = config.getMappingInfo().getServiceName();
      this.binding = config.getWsdlPort();
      this.classLoader = config.getClassLoader();
      this.portName = config.getMappingInfo().getPortName();
      this.config = config;
      this.wsBinding = config.getWSBinding();
      metadataReader = config.getMetadataReader();
      targetNamespace = config.getMappingInfo().getTargetNamespace();
      if (metadataReader == null) metadataReader = new ReflectAnnotationReader();
      if (wsBinding != null) {
          this.bindingId = wsBinding.getBindingId();
              if (config.getFeatures() != null) wsBinding.getFeatures().mergeFeatures(config.getFeatures(), false);
              if (binding != null) wsBinding.getFeatures().mergeFeatures(binding.getFeatures(), false);
              this.features = WebServiceFeatureList.toList(wsBinding.getFeatures());
      } else {
          this.bindingId = config.getMappingInfo().getBindingID();
          this.features = WebServiceFeatureList.toList(config.getFeatures());
          if (binding != null) bindingId = binding.getBinding().getBindingId();
          if (bindingId == null) bindingId = getDefaultBindingID();
          if (!features.contains(MTOMFeature.class)) {
              MTOM mtomAn = getAnnotation(portClass, MTOM.class);
              if (mtomAn != null) features.add(WebServiceFeatureList.getFeature(mtomAn));
          }
          if (!features.contains(com.oracle.webservices.internal.api.EnvelopeStyleFeature.class)) {
              com.oracle.webservices.internal.api.EnvelopeStyle es = getAnnotation(portClass, com.oracle.webservices.internal.api.EnvelopeStyle.class);
              if (es != null) features.add(WebServiceFeatureList.getFeature(es));
          }
          this.wsBinding = bindingId.createBinding(features);
      }
  }
 
Example 9
Source Project: openjdk-jdk8u-backup   Source File: XmlMTOM.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public Class<? extends Annotation> annotationType() {
    return MTOM.class;
}
 
Example 10
Source Project: openjdk-jdk9   Source File: RuntimeModeler.java    License: GNU General Public License v2.0 4 votes vote down vote up
/**
   *
   * creates an instance of RunTimeModeler given a <code>sei</code> and <code>binding</code>
   * @param portClass The SEI class to be modeled.
   * @param serviceName The ServiceName to use instead of one calculated from the implementation class
   * @param wsdlPort {@link com.sun.xml.internal.ws.api.model.wsdl.WSDLPort}
   * @param features web service features
   */
/*public RuntimeModeler(@NotNull Class portClass, @NotNull QName serviceName, @NotNull WSDLPortImpl wsdlPort, @NotNull WebServiceFeature... features){
      this(portClass, serviceName, wsdlPort, wsdlPort.getBinding().getBindingId(), features);
  }*/

/*private RuntimeModeler(@NotNull Class portClass, @NotNull QName serviceName, WSDLPortImpl binding, BindingID bindingId, @NotNull WebServiceFeature... features) {
      this.portClass = portClass;
      this.serviceName = serviceName;
      this.binding = binding;
      this.bindingId = bindingId;
      this.features = features;
  }*/

  public RuntimeModeler(@NotNull DatabindingConfig config){
      this.portClass = (config.getEndpointClass() != null)? config.getEndpointClass() : config.getContractClass();
      this.serviceName = config.getMappingInfo().getServiceName();
      this.binding = config.getWsdlPort();
      this.classLoader = config.getClassLoader();
      this.portName = config.getMappingInfo().getPortName();
      this.config = config;
      this.wsBinding = config.getWSBinding();
      metadataReader = config.getMetadataReader();
      targetNamespace = config.getMappingInfo().getTargetNamespace();
      if (metadataReader == null) metadataReader = new ReflectAnnotationReader();
      if (wsBinding != null) {
          this.bindingId = wsBinding.getBindingId();
              if (config.getFeatures() != null) wsBinding.getFeatures().mergeFeatures(config.getFeatures(), false);
              if (binding != null) wsBinding.getFeatures().mergeFeatures(binding.getFeatures(), false);
              this.features = WebServiceFeatureList.toList(wsBinding.getFeatures());
      } else {
          this.bindingId = config.getMappingInfo().getBindingID();
          this.features = WebServiceFeatureList.toList(config.getFeatures());
          if (binding != null) bindingId = binding.getBinding().getBindingId();
          if (bindingId == null) bindingId = getDefaultBindingID();
          if (!features.contains(MTOMFeature.class)) {
              MTOM mtomAn = getAnnotation(portClass, MTOM.class);
              if (mtomAn != null) features.add(WebServiceFeatureList.getFeature(mtomAn));
          }
          if (!features.contains(com.oracle.webservices.internal.api.EnvelopeStyleFeature.class)) {
              com.oracle.webservices.internal.api.EnvelopeStyle es = getAnnotation(portClass, com.oracle.webservices.internal.api.EnvelopeStyle.class);
              if (es != null) features.add(WebServiceFeatureList.getFeature(es));
          }
          this.wsBinding = bindingId.createBinding(features);
      }
  }
 
Example 11
Source Project: openjdk-jdk9   Source File: XmlMTOM.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public Class<? extends Annotation> annotationType() {
    return MTOM.class;
}
 
Example 12
Source Project: hottub   Source File: RuntimeModeler.java    License: GNU General Public License v2.0 4 votes vote down vote up
/**
   *
   * creates an instance of RunTimeModeler given a <code>sei</code> and <code>binding</code>
   * @param portClass The SEI class to be modeled.
   * @param serviceName The ServiceName to use instead of one calculated from the implementation class
   * @param wsdlPort {@link com.sun.xml.internal.ws.api.model.wsdl.WSDLPort}
   * @param features web service features
   */
/*public RuntimeModeler(@NotNull Class portClass, @NotNull QName serviceName, @NotNull WSDLPortImpl wsdlPort, @NotNull WebServiceFeature... features){
      this(portClass, serviceName, wsdlPort, wsdlPort.getBinding().getBindingId(), features);
  }*/

/*private RuntimeModeler(@NotNull Class portClass, @NotNull QName serviceName, WSDLPortImpl binding, BindingID bindingId, @NotNull WebServiceFeature... features) {
      this.portClass = portClass;
      this.serviceName = serviceName;
      this.binding = binding;
      this.bindingId = bindingId;
      this.features = features;
  }*/

  public RuntimeModeler(@NotNull DatabindingConfig config){
      this.portClass = (config.getEndpointClass() != null)? config.getEndpointClass() : config.getContractClass();
      this.serviceName = config.getMappingInfo().getServiceName();
      this.binding = config.getWsdlPort();
      this.classLoader = config.getClassLoader();
      this.portName = config.getMappingInfo().getPortName();
      this.config = config;
      this.wsBinding = config.getWSBinding();
      metadataReader = config.getMetadataReader();
      targetNamespace = config.getMappingInfo().getTargetNamespace();
      if (metadataReader == null) metadataReader = new ReflectAnnotationReader();
      if (wsBinding != null) {
          this.bindingId = wsBinding.getBindingId();
              if (config.getFeatures() != null) wsBinding.getFeatures().mergeFeatures(config.getFeatures(), false);
              if (binding != null) wsBinding.getFeatures().mergeFeatures(binding.getFeatures(), false);
              this.features = WebServiceFeatureList.toList(wsBinding.getFeatures());
      } else {
          this.bindingId = config.getMappingInfo().getBindingID();
          this.features = WebServiceFeatureList.toList(config.getFeatures());
          if (binding != null) bindingId = binding.getBinding().getBindingId();
          if (bindingId == null) bindingId = getDefaultBindingID();
          if (!features.contains(MTOMFeature.class)) {
              MTOM mtomAn = getAnnotation(portClass, MTOM.class);
              if (mtomAn != null) features.add(WebServiceFeatureList.getFeature(mtomAn));
          }
          if (!features.contains(com.oracle.webservices.internal.api.EnvelopeStyleFeature.class)) {
              com.oracle.webservices.internal.api.EnvelopeStyle es = getAnnotation(portClass, com.oracle.webservices.internal.api.EnvelopeStyle.class);
              if (es != null) features.add(WebServiceFeatureList.getFeature(es));
          }
          this.wsBinding = bindingId.createBinding(features);
      }
  }
 
Example 13
Source Project: hottub   Source File: XmlMTOM.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public Class<? extends Annotation> annotationType() {
    return MTOM.class;
}
 
Example 14
/**
   *
   * creates an instance of RunTimeModeler given a <code>sei</code> and <code>binding</code>
   * @param portClass The SEI class to be modeled.
   * @param serviceName The ServiceName to use instead of one calculated from the implementation class
   * @param wsdlPort {@link com.sun.xml.internal.ws.api.model.wsdl.WSDLPort}
   * @param features web service features
   */
/*public RuntimeModeler(@NotNull Class portClass, @NotNull QName serviceName, @NotNull WSDLPortImpl wsdlPort, @NotNull WebServiceFeature... features){
      this(portClass, serviceName, wsdlPort, wsdlPort.getBinding().getBindingId(), features);
  }*/

/*private RuntimeModeler(@NotNull Class portClass, @NotNull QName serviceName, WSDLPortImpl binding, BindingID bindingId, @NotNull WebServiceFeature... features) {
      this.portClass = portClass;
      this.serviceName = serviceName;
      this.binding = binding;
      this.bindingId = bindingId;
      this.features = features;
  }*/

  public RuntimeModeler(@NotNull DatabindingConfig config){
      this.portClass = (config.getEndpointClass() != null)? config.getEndpointClass() : config.getContractClass();
      this.serviceName = config.getMappingInfo().getServiceName();
      this.binding = config.getWsdlPort();
      this.classLoader = config.getClassLoader();
      this.portName = config.getMappingInfo().getPortName();
      this.config = config;
      this.wsBinding = config.getWSBinding();
      metadataReader = config.getMetadataReader();
      targetNamespace = config.getMappingInfo().getTargetNamespace();
      if (metadataReader == null) metadataReader = new ReflectAnnotationReader();
      if (wsBinding != null) {
          this.bindingId = wsBinding.getBindingId();
              if (config.getFeatures() != null) wsBinding.getFeatures().mergeFeatures(config.getFeatures(), false);
              if (binding != null) wsBinding.getFeatures().mergeFeatures(binding.getFeatures(), false);
              this.features = WebServiceFeatureList.toList(wsBinding.getFeatures());
      } else {
          this.bindingId = config.getMappingInfo().getBindingID();
          this.features = WebServiceFeatureList.toList(config.getFeatures());
          if (binding != null) bindingId = binding.getBinding().getBindingId();
          if (bindingId == null) bindingId = getDefaultBindingID();
          if (!features.contains(MTOMFeature.class)) {
              MTOM mtomAn = getAnnotation(portClass, MTOM.class);
              if (mtomAn != null) features.add(WebServiceFeatureList.getFeature(mtomAn));
          }
          if (!features.contains(com.oracle.webservices.internal.api.EnvelopeStyleFeature.class)) {
              com.oracle.webservices.internal.api.EnvelopeStyle es = getAnnotation(portClass, com.oracle.webservices.internal.api.EnvelopeStyle.class);
              if (es != null) features.add(WebServiceFeatureList.getFeature(es));
          }
          this.wsBinding = bindingId.createBinding(features);
      }
  }
 
Example 15
Source Project: openjdk-8-source   Source File: XmlMTOM.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public Class<? extends Annotation> annotationType() {
    return MTOM.class;
}
 
Example 16
Source Project: openjdk-8   Source File: RuntimeModeler.java    License: GNU General Public License v2.0 4 votes vote down vote up
/**
   *
   * creates an instance of RunTimeModeler given a <code>sei</code> and <code>binding</code>
   * @param portClass The SEI class to be modeled.
   * @param serviceName The ServiceName to use instead of one calculated from the implementation class
   * @param wsdlPort {@link com.sun.xml.internal.ws.api.model.wsdl.WSDLPort}
   * @param features web service features
   */
/*public RuntimeModeler(@NotNull Class portClass, @NotNull QName serviceName, @NotNull WSDLPortImpl wsdlPort, @NotNull WebServiceFeature... features){
      this(portClass, serviceName, wsdlPort, wsdlPort.getBinding().getBindingId(), features);
  }*/

/*private RuntimeModeler(@NotNull Class portClass, @NotNull QName serviceName, WSDLPortImpl binding, BindingID bindingId, @NotNull WebServiceFeature... features) {
      this.portClass = portClass;
      this.serviceName = serviceName;
      this.binding = binding;
      this.bindingId = bindingId;
      this.features = features;
  }*/

  public RuntimeModeler(@NotNull DatabindingConfig config){
      this.portClass = (config.getEndpointClass() != null)? config.getEndpointClass() : config.getContractClass();
      this.serviceName = config.getMappingInfo().getServiceName();
      this.binding = config.getWsdlPort();
      this.classLoader = config.getClassLoader();
      this.portName = config.getMappingInfo().getPortName();
      this.config = config;
      this.wsBinding = config.getWSBinding();
      metadataReader = config.getMetadataReader();
      targetNamespace = config.getMappingInfo().getTargetNamespace();
      if (metadataReader == null) metadataReader = new ReflectAnnotationReader();
      if (wsBinding != null) {
          this.bindingId = wsBinding.getBindingId();
              if (config.getFeatures() != null) wsBinding.getFeatures().mergeFeatures(config.getFeatures(), false);
              if (binding != null) wsBinding.getFeatures().mergeFeatures(binding.getFeatures(), false);
              this.features = WebServiceFeatureList.toList(wsBinding.getFeatures());
      } else {
          this.bindingId = config.getMappingInfo().getBindingID();
          this.features = WebServiceFeatureList.toList(config.getFeatures());
          if (binding != null) bindingId = binding.getBinding().getBindingId();
          if (bindingId == null) bindingId = getDefaultBindingID();
          if (!features.contains(MTOMFeature.class)) {
              MTOM mtomAn = getAnnotation(portClass, MTOM.class);
              if (mtomAn != null) features.add(WebServiceFeatureList.getFeature(mtomAn));
          }
          if (!features.contains(com.oracle.webservices.internal.api.EnvelopeStyleFeature.class)) {
              com.oracle.webservices.internal.api.EnvelopeStyle es = getAnnotation(portClass, com.oracle.webservices.internal.api.EnvelopeStyle.class);
              if (es != null) features.add(WebServiceFeatureList.getFeature(es));
          }
          this.wsBinding = bindingId.createBinding(features);
      }
  }
 
Example 17
Source Project: openjdk-8   Source File: XmlMTOM.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public Class<? extends Annotation> annotationType() {
    return MTOM.class;
}
 
Example 18
Source Project: cxf   Source File: JaxWsServiceFactoryBean.java    License: Apache License 2.0 4 votes vote down vote up
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;
    }
}