List of usage examples for javax.xml.ws.soap SOAPBinding isMTOMEnabled
public boolean isMTOMEnabled();
From source file:eu.planets_project.ifr.core.servreg.utils.client.PlanetsCommand.java
/** * /* w w w .j a v a 2 s. co m*/ * @param args */ public static void main(String[] args) { /* FIXME, point to log4j.properties instead of doing this? */ /* java.util.logging.Logger.getLogger("com.sun.xml.ws.model").setLevel(java.util.logging.Level.WARNING); java.util.logging.Logger.getAnonymousLogger().setLevel(java.util.logging.Level.WARNING); Logger sunlogger = Logger.getLogger("com.sun.xml.ws.model"); sunlogger.setLevel(Level.WARNING); java.util.logging.Logger.getLogger( com.sun.xml.ws.util.Constants.LoggingDomain).setLevel(java.util.logging.Level.WARNING); */ /* Lots of info please: */ java.util.logging.Logger.getAnonymousLogger().setLevel(java.util.logging.Level.FINEST); java.util.logging.Logger.getLogger(com.sun.xml.ws.util.Constants.LoggingDomain) .setLevel(java.util.logging.Level.FINEST); // TODO See https://jax-ws.dev.java.net/guide/Logging.html for info on more logging to set up. //System.setProperty("com.sun.xml.ws.transport.local.LocalTransportPipe.dump","true"); //System.setProperty("com.sun.xml.ws.util.pipe.StandaloneTubeAssembler.dump","true"); //System.setProperty("com.sun.xml.ws.transport.http.HttpAdapter.dump","true"); // Doing this KILLS STREAMING. Log that. //System.setProperty("com.sun.xml.ws.transport.http.client.HttpTransportPipe.dump","true"); URL wsdl; try { wsdl = new URL(args[0]); } catch (MalformedURLException e) { e.printStackTrace(); return; } PlanetsServiceExplorer pse = new PlanetsServiceExplorer(wsdl); System.out.println(".describe(): " + pse.getServiceDescription()); Service service = Service.create(wsdl, pse.getQName()); //service.addPort(portName, SOAPBinding.SOAP11HTTP_MTOM_BINDING, endpointAddress) PlanetsService ps = (PlanetsService) service.getPort(pse.getServiceClass()); // TODO The client wrapper code should enforce this stuff: SOAPBinding binding = (SOAPBinding) ((BindingProvider) ps).getBinding(); System.out.println("Logging MTOM=" + binding.isMTOMEnabled()); ((BindingProvider) ps).getRequestContext().put(JAXWSProperties.MTOM_THRESHOLOD_VALUE, 8192); ((BindingProvider) ps).getRequestContext().put(JAXWSProperties.HTTP_CLIENT_STREAMING_CHUNK_SIZE, 8192); System.out.println("Logging MTOM=" + binding.isMTOMEnabled()); binding.setMTOMEnabled(true); System.out.println("Logging MTOM=" + binding.isMTOMEnabled()); //System.out.println("Logging MTOM="+((BindingProvider)ps).getBinding().getBindingID()+" v. "+SOAPBinding.SOAP11HTTP_MTOM_BINDING); /* * The different services are invoked in different ways... */ if (pse.getQName().equals(Migrate.QNAME)) { System.out.println("Is a Migrate service. "); Migrate s = MigrateWrapper.createWrapper(wsdl); DigitalObject dobIn = new DigitalObject.Builder(Content.byReference(new File(args[1]))).build(); MigrateResult result = s.migrate(dobIn, URI.create(args[2]), URI.create(args[3]), null); System.out.println("ServiceReport: " + result.getReport()); DigitalObjectUtils.toFile(result.getDigitalObject(), new File("output")); } else if (pse.getQName().equals(Identify.QNAME)) { System.out.println("Is an Identify service. "); Identify s = new IdentifyWrapper(wsdl); DigitalObject dobIn = new DigitalObject.Builder(Content.byReference(new File(args[1]))).build(); IdentifyResult result = s.identify(dobIn, null); System.out.println("ServiceReport: " + result.getReport()); } }
From source file:org.apache.axis2.jaxws.client.dispatch.BaseDispatch.java
private void setupMessageProperties(Message msg) { // If the user has enabled MTOM on the SOAPBinding, we need // to make sure that gets pushed to the Message object. Binding binding = (Binding) getBinding(); if (binding != null && binding instanceof SOAPBinding) { SOAPBinding soapBinding = (SOAPBinding) binding; if (soapBinding.isMTOMEnabled()) msg.setMTOMEnabled(true);/*www.ja va 2s. c om*/ } }