1 package org.apache.axis2.wsdl; 2 3 import org.apache.axis2.wsdl.codegen.CodeGenerationEngine; 4 import org.apache.axis2.wsdl.codegen.CommandLineOptionConstants; 5 import org.apache.axis2.wsdl.codegen.CommandLineOptionParser; 6 7 22 public class WSDL2Code { 23 24 25 public static void main(String [] args) throws Exception { 26 CommandLineOptionParser commandLineOptionParser = new CommandLineOptionParser(args); 27 validateCommandLineOptions(commandLineOptionParser); 28 new CodeGenerationEngine(commandLineOptionParser).generate(); 29 30 } 31 32 private static void printUsage(){ 33 System.out.println("Usage WSDL2Code -uri <Location of WSDL> :WSDL file location "); 34 System.out.println("-o <output Location> : output file location "); 35 System.out.println("-a : Generate async style code only. Default if off"); 36 System.out.println("-s : Generate sync style code only. Default if off. takes precedence over -a"); 37 System.out.println("-p <package name> : set custom package name"); 38 System.out.println("-l <language> : valid languages are java and csharp. Default is java"); 39 System.out.println("-t : Generate TestCase to test the generated code"); 40 System.out.println("-ss : Generate server side code (i.e. skeletons).Default is off"); 41 System.out.println("-sd : Generate service descriptor (i.e. axis2.xml).Default is off.Valid with -ss "); 42 System.exit(0); 43 } 44 45 46 47 private static void validateCommandLineOptions(CommandLineOptionParser parser){ 48 if(parser.getInvalidOptions().size()>0) 49 printUsage(); 50 if(null == parser.getAllOptions().get(CommandLineOptionConstants.WSDL_LOCATION_URI_OPTION)) 51 printUsage(); 52 } 53 54 55 56 } 57 | Popular Tags |