javax.xml.ws.soap.MTOM类的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(8.0k)|赞(0)|评价(0)|浏览(143)

本文整理了Java中javax.xml.ws.soap.MTOM类的一些代码示例,展示了MTOM类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MTOM类的具体详情如下:
包路径:javax.xml.ws.soap.MTOM
类名称:MTOM

MTOM介绍

暂无

代码示例

代码示例来源:origin: roskart/dropwizard-jaxws

@MTOM // @MTOM annotation is not necessary if you invoke enableMtom on EndopointBuilder
@WebService(endpointInterface = "ws.example.jaxws.dropwizard.roskart.com.mtomservice.MtomService",
    targetNamespace = "http://com.roskart.dropwizard.jaxws.example.ws/MtomService",
    name = "MtomService",
    wsdlLocation = "META-INF/MtomService.wsdl")
public class MtomServiceImpl implements MtomService {
  @Metered
  @Override
  public HelloResponse hello(Hello parameters) {
    try {
      byte[] bin = IOUtils.readBytesFromStream(parameters.getBinary().getInputStream());
      HelloResponse response = new HelloResponse();
      response.setTitle(parameters.getTitle());
      response.setBinary(new DataHandler(new ByteArrayDataSource(bin,
          parameters.getBinary().getContentType())));
      return response;
    }
    catch(IOException e) {
      throw new RuntimeException(e);
    }
  }
}

代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws

features.add(new MTOMFeature(mtom.enabled(), mtom.threshold()));
} else {

代码示例来源:origin: org.jboss.ws.cxf/jbossws-cxf-server

protected boolean isMtomEnabled(Class<?> beanClass)
{
 BindingType bindingType = (BindingType)beanClass.getAnnotation(BindingType.class);
 MTOM mtom = (MTOM)beanClass.getAnnotation(MTOM.class);
 boolean mtomEnabled = mtom != null && mtom.enabled();
 if (!mtomEnabled && bindingType != null)
 {
   String binding = bindingType.value();
   mtomEnabled = binding.equals(SOAPBinding.SOAP11HTTP_MTOM_BINDING) || binding.equals(SOAPBinding.SOAP12HTTP_MTOM_BINDING);
 }
 
 return mtomEnabled;
}

代码示例来源:origin: apache/axis2-java

public boolean isMTOMEnabled() {
  if (isMTOMEnabledCache != null) {
    return isMTOMEnabledCache.booleanValue();
  }
  
  // isMTOMEnabled is a combination of the @BindingType and the @MTOM setting.
  MTOM mtomAnnotation =
      (MTOM) getAnnoFeature(MTOMFeature.ID);
  
  // If the @MTOM annotation is set, it wins
  if (mtomAnnotation != null) {
    isMTOMEnabledCache = Boolean.valueOf(mtomAnnotation.enabled());
    return isMTOMEnabledCache.booleanValue();
  }
  
  // Else look at the bindingType
  String bindingType = getBindingType();
  isMTOMEnabledCache = Boolean.valueOf(isMTOMBinding(bindingType));
  return isMTOMEnabledCache.booleanValue();
}

代码示例来源:origin: org.jboss.eap/wildfly-webservices-server-integration

private static void processMTOMAnnotation(final AnnotatedElement anElement, final UnifiedServiceRefMetaData serviceRefUMDM) {
  final MTOM mtomAnnotation = getAnnotation(anElement, MTOM.class);
  if (mtomAnnotation != null) {
   serviceRefUMDM.setMTOMMetadata(new MTOMMetadata(true, mtomAnnotation.enabled(), mtomAnnotation.threshold()));
  }
}

代码示例来源:origin: apache/cxf

@MTOM
public class HelloImpl implements Hello {
  public void detail(Holder<byte[]> photo, Holder<Image> image) {
    // echo through Holder
  }

  public void echoData(Holder<byte[]> data) {
    // echo through Holder
  }
}

代码示例来源:origin: org.apache.axis2/axis2-metadata

public boolean isMTOMEnabled() {
  if (isMTOMEnabledCache != null) {
    return isMTOMEnabledCache.booleanValue();
  }
  
  // isMTOMEnabled is a combination of the @BindingType and the @MTOM setting.
  MTOM mtomAnnotation =
      (MTOM) getAnnoFeature(MTOMFeature.ID);
  
  // If the @MTOM annotation is set, it wins
  if (mtomAnnotation != null) {
    isMTOMEnabledCache = Boolean.valueOf(mtomAnnotation.enabled());
    return isMTOMEnabledCache.booleanValue();
  }
  
  // Else look at the bindingType
  String bindingType = getBindingType();
  isMTOMEnabledCache = Boolean.valueOf(isMTOMBinding(bindingType));
  return isMTOMEnabledCache.booleanValue();
}

代码示例来源:origin: org.wildfly/wildfly-webservices-server-integration

private static void processMTOMAnnotation(final AnnotatedElement anElement, final UnifiedServiceRefMetaData serviceRefUMDM) {
  final MTOM mtomAnnotation = getAnnotation(anElement, MTOM.class);
  if (mtomAnnotation != null) {
   serviceRefUMDM.setMTOMMetadata(new MTOMMetadata(true, mtomAnnotation.enabled(), mtomAnnotation.threshold()));
  }
}

代码示例来源:origin: org.apache.chemistry.opencmis/chemistry-opencmis-server-bindings

@MTOM
@WebService(endpointInterface = "org.apache.chemistry.opencmis.server.impl.webservices.RepositoryServicePort10")
public class RepositoryService10 extends RepositoryService implements RepositoryServicePort10 {

代码示例来源:origin: org.apache.openejb/openejb-core

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());
    }
  }
}

代码示例来源:origin: org.apache.chemistry.opencmis/chemistry-opencmis-server-bindings

@MTOM
@WebService(endpointInterface = "org.apache.chemistry.opencmis.server.impl.webservices.ObjectServicePort10")
public class ObjectService10 extends ObjectService implements ObjectServicePort10 {

代码示例来源:origin: org.apache.tomee/openejb-core

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());
    }
  }
}

代码示例来源:origin: org.wildfly.extras.patch/fuse-patch-core

@MTOM
@WebService(targetNamespace = RepositoryService.TARGET_NAMESPACE)
public interface RepositoryService {

代码示例来源:origin: org.jboss.as/jboss-as-webservices-server-integration

private static void processMTOMAnnotation(final AnnotatedElement anElement, final UnifiedServiceRefMetaData serviceRefUMDM) {
  final MTOM mtomAnnotation = getAnnotation(anElement, MTOM.class);
  if (mtomAnnotation != null) {
   serviceRefUMDM.setMtomAnnotationSpecified(true);
   serviceRefUMDM.setMtomEnabled(mtomAnnotation.enabled());
   serviceRefUMDM.setMtomThreshold(mtomAnnotation.threshold());
  }
}

代码示例来源:origin: org.apache.chemistry.opencmis/chemistry-opencmis-server-bindings

@MTOM
@WebService(endpointInterface = "org.apache.chemistry.opencmis.commons.impl.jaxb.RelationshipServicePort")
public class RelationshipService extends AbstractService implements RelationshipServicePort {

代码示例来源:origin: apache/cxf

features.add(new MTOMFeature(mtom.enabled(), mtom.threshold()));
} else {

代码示例来源:origin: edu.unc.mapseq.pipelines.casava.casava-web/casava-web-service-api

@MTOM(enabled = true, threshold = 0)
@BindingType(value = javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_MTOM_BINDING)
@WebService(targetNamespace = "http://casava.ws.mapseq.unc.edu", serviceName = "CASAVAService", portName = "CASAVAPort")
@SOAPBinding(style = Style.DOCUMENT, use = Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
@Path("/CASAVAService/")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public interface CASAVAService {

  @WebMethod
  public Long uploadSampleSheet(@WebParam(name = "data") DataHandler data,
      @WebParam(name = "flowcellName") String flowcellName);

  @GET
  @Path("/assertDirectoryExists/{studyName}/{flowcell}")
  @WebMethod
  public Boolean assertDirectoryExists(@PathParam("studyName") @WebParam(name = "studyName") String studyName,
      @PathParam("flowcell") @WebParam(name = "flowcell") String flowcell);

}

代码示例来源:origin: org.apache.axis2/axis2-metadata

if (mtomAnnoation.enabled()) {
  if (log.isDebugEnabled()) {
    log.debug("Enabling MTOM via annotation.");
if (mtomAnnoation.threshold() > 0) {
  if (log.isDebugEnabled()) {
    log.debug("Setting MTOM threshold to [" + mtomAnnoation.threshold() + "].");
  threshold.setValue(mtomAnnoation.threshold());

代码示例来源:origin: org.apache.chemistry.opencmis/chemistry-opencmis-server-bindings

@MTOM
@WebService(endpointInterface = "org.apache.chemistry.opencmis.commons.impl.jaxb.MultiFilingServicePort")
public class MultiFilingService extends AbstractService implements MultiFilingServicePort {

代码示例来源:origin: apache/axis2-java

if (mtomAnnoation.enabled()) {
  if (log.isDebugEnabled()) {
    log.debug("Enabling MTOM via annotation.");
if (mtomAnnoation.threshold() > 0) {
  if (log.isDebugEnabled()) {
    log.debug("Setting MTOM threshold to [" + mtomAnnoation.threshold() + "].");
  threshold.setValue(mtomAnnoation.threshold());

相关文章