private static EndpointReference targetEPR = new EndpointReference(
"http://localhost:8080/axis2/services/SWASampleService");
public static void main(String[] args) throws Exception {
CommandLineOptionParser optionsParser = new CommandLineOptionParser(
args);
List invalidOptionsList = optionsParser
.getInvalidOptions(new OptionsValidator() {
public boolean isInvalid(CommandLineOption option) {
String optionType = option.getOptionType();
return !("dest".equalsIgnoreCase(optionType) || "file"
.equalsIgnoreCase(optionType));
}
});
if ((invalidOptionsList.size() > 0) || (args.length != 4)) {
// printUsage();
System.out
.println("Invalid Parameters. Usage -file <file to be send> -dest <destination file>");
return;
}
Map optionsMap = optionsParser.getAllOptions();
CommandLineOption fileOption = (CommandLineOption) optionsMap
.get("file");
CommandLineOption destinationOption = (CommandLineOption) optionsMap
.get("dest");