Java Reference
In-Depth Information
String version = profile.getVersion();
System.out.print("Version: " + version);
}
public static Connection createConnection() {
Connection connection = null;
try {
Properties props = new Properties();
props.setProperty("javax.xml.registry.queryManagerURL",
INQURY_URI);
props.setProperty("javax.xml.registry.lifeCycleManagerURL",
PUBLISH_URI);
System.setProperty("javax.xml.registry.ConnectionFactoryClass",
"com.sun.xml.registry.uddi.ConnectionFactoryImpl");
ConnectionFactory factory = ConnectionFactory.newInstance();
factory.setProperties(props);
connection = factory.createConnection();
} catch (JAXRException ex) {
ex.printStackTrace();
}
return connection;
}
}
You get the properties for connecting to the UDDI registry just as you might for connecting to
a JMS or EJB service, and once your connection is created, you use the
BusinessQueryMan-
ager
class to execute JAX-R queries. You execute a
findOrganizations
query, which re-
turns a
BulkResponse
, and then loop over it to print the results.
See Also
You can also try the free and open source Apache Scout project, available at
ht-
tp://ws.apache.org/scout
. There are precious few examples of using Scout, and continued
activity on the project is unclear. But if you're willing to slog through the JavaDoc for the
API, it's available. Scout is packaged with some popular open source containers, including
Apache Geronimo and JBoss 4.0.2 and better.