Map<String, List<Annotation>> map = new HashMap();
ArrayList<Annotation> wsFeatures = new ArrayList<Annotation>();
// Enable MTOM explicitly on one port
MTOMAnnot mtomFeature = new MTOMAnnot();
mtomFeature.setEnabled(true);
mtomFeature.setThreshold(MTOM_THRESHOLD);
wsFeatures.add(mtomFeature);
map.put(ClientMetadataMTOMPortSEI.class.getName(), wsFeatures);
// Disable MTOM explicitly on a different port
ArrayList<Annotation> wsFeatures2 = new ArrayList<Annotation>();
MTOMAnnot mtomFeatureDisable = new MTOMAnnot();
mtomFeatureDisable.setEnabled(false);
wsFeatures2.add(mtomFeatureDisable);
map.put(ClientMetadataMTOMPortSEI2.class.getName(), wsFeatures2);
serviceDBC.getProperties().put(MDQConstants.SEI_FEATURES_MAP, map);
ServiceDelegate.setServiceMetadata(serviceDBC);