@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); } } }
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; }
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(); }
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())); } }
@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 } }
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(); }
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())); } }
@MTOM @WebService(endpointInterface = "org.apache.chemistry.opencmis.server.impl.webservices.RepositoryServicePort10") public class RepositoryService10 extends RepositoryService implements RepositoryServicePort10 {
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()); } } }
@MTOM @WebService(endpointInterface = "org.apache.chemistry.opencmis.server.impl.webservices.ObjectServicePort10") public class ObjectService10 extends ObjectService implements ObjectServicePort10 {
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()); } } }
@MTOM @WebService(targetNamespace = RepositoryService.TARGET_NAMESPACE) public interface RepositoryService {
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()); } }
@MTOM @WebService(endpointInterface = "org.apache.chemistry.opencmis.commons.impl.jaxb.RelationshipServicePort") public class RelationshipService extends AbstractService implements RelationshipServicePort {
@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); }
@MTOM @WebService(endpointInterface = "org.apache.chemistry.opencmis.commons.impl.jaxb.MultiFilingServicePort") public class MultiFilingService extends AbstractService implements MultiFilingServicePort {