List of usage examples for javax.xml.ws.soap MTOMFeature MTOMFeature
public MTOMFeature(boolean enabled, int threshold)
From source file:be.e_contract.mycarenet.ehbox.EHealthBoxPublicationClient.java
/** * Main constructor.//from w w w .ja v a 2 s . co m * * @param location * the URL of the eHealth Publication version 3.0 web service. */ public EHealthBoxPublicationClient(String location) { EhBoxPublicationService publicationService = EhBoxPublicationServiceFactory.newInstance(); /* * Nasty way to disable MTOM for Apache CXF. */ this.ehBoxPublicationPort = publicationService .getEhBoxPublicationPort(new MTOMFeature(false, 1024 * 1024 * 1024)); QName publicationPortQName = new QName("urn:be:fgov:ehealth:ehbox:publication:protocol:v3", "ehBoxPublicationPort"); this.publicationDispatch = publicationService.createDispatch(publicationPortQName, Source.class, Service.Mode.PAYLOAD); this.wsSecuritySOAPHandler = new WSSecuritySOAPHandler(); this.payloadLogicalHandler = new PayloadLogicalHandler(); configureBindingProvider((BindingProvider) this.ehBoxPublicationPort, location); configureBindingProvider(this.publicationDispatch, location); }
From source file:org.seedstack.seed.ws.internal.WSPlugin.java
private WSBinding createBinding(String ddBindingId, Class implClass, Boolean mtomEnabled, Integer mtomThreshold, String dataBindingMode) { WebServiceFeatureList features;/*from w ww . ja v a 2 s. co m*/ MTOMFeature mtomfeature = null; if (mtomEnabled != null) { if (mtomThreshold != null) { mtomfeature = new MTOMFeature(mtomEnabled, mtomThreshold); } else { mtomfeature = new MTOMFeature(mtomEnabled); } } BindingID bindingID; if (ddBindingId != null) { bindingID = BindingID.parse(ddBindingId); features = bindingID.createBuiltinFeatureList(); if (checkMtomConflict(features.get(MTOMFeature.class), mtomfeature)) { throw new ServerRtException(ServerMessages.DD_MTOM_CONFLICT(ddBindingId, mtomEnabled)); } } else { bindingID = BindingID.parse(implClass); features = new WebServiceFeatureList(); if (mtomfeature != null) { features.add(mtomfeature); } features.addAll(bindingID.createBuiltinFeatureList()); } if (dataBindingMode != null) { features.add(new DatabindingModeFeature(dataBindingMode)); } return bindingID.createBinding(features.toArray()); }