@Test public void testMain() { String[] testbedTest = { "http: "tests/test-files/images/bitmap/test_png/png_small/2274192346_4a0a03c5d6.png", "planets:fmt/ext/png", "planets:fmt/ext/jpg"}; PlanetsCommand.main(testbedTest); System.out.println("---- TEST -------------------------------------------------------------------------------------"); String[] dialogikaTest = { "http: "tests/test-files/documents/test_word_6.0/SETUP.DOC", "planets:fmt/ext/doc", "planets:fmt/ext/docx"}; PlanetsCommand.main(dialogikaTest); }
public static void main(String[] args) { 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); 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()); PlanetsService ps = (PlanetsService) service.getPort(pse.getServiceClass()); 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()); 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()); } }
PlanetsCommand { public static void main(String[] args) { 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); 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()); PlanetsService ps = (PlanetsService) service.getPort(pse.getServiceClass()); 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()); 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()); } } }
PlanetsCommand { public static void main(String[] args) { 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); 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()); PlanetsService ps = (PlanetsService) service.getPort(pse.getServiceClass()); 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()); 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()); } }  }
PlanetsCommand { public static void main(String[] args) { 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); 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()); PlanetsService ps = (PlanetsService) service.getPort(pse.getServiceClass()); 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()); 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()); } }  static void main(String[] args); }
PlanetsCommand { public static void main(String[] args) { 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); 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()); PlanetsService ps = (PlanetsService) service.getPort(pse.getServiceClass()); 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()); 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()); } }  static void main(String[] args);  }