// Validate arguments
if (args.length != 2) {
usage();
}
// Process the arguments
boolean isUddi = args[0].equals("-uddi");
String queryURL = args[1];
try {
// Get the ConnectionFactory
Properties props = new Properties();
props.put("javax.xml.registry.queryManagerURL", queryURL);
boolean displayID = false;
if (isUddi) {
String fileName = System.getProperty("CustomEnumFile");
if (fileName != null) {
System.out.println("Custom taxonomy file is " + fileName);
System.setProperty("com.sun.xml.registry.userTaxonomyFilenames", fileName);
} else {
displayID = true; // Step 1 - just display the ID
}
}
ConnectionFactory cf = ConnectionFactory.newInstance();
cf.setProperties(props);
// Get and initialize the connection
Connection conn = cf.createConnection();
conn.setSynchronous(true);
// Get the RegistryService and the BusinessQueryManager
RegistryService registry = conn.getRegistryService();
bqm = registry.getBusinessQueryManager();
// Run the example code
displayEnum(displayID);
// Close connection
conn.close();
} catch (Throwable t) {
System.out.println(t);
t.printStackTrace(System.out);
System.exit(1);
}
System.exit(0);