background image

Web Services Description Language

<< Finding Organizations by Classification | Finding Services and Service Bindings >>
<< Finding Organizations by Classification | Finding Services and Service Bindings >>
184
J
AVA
API
FOR
XML R
EGISTRIES
code except that it ends with a call to
findConcepts
instead of
findOrganiza-
tions
.
String schemeName = "uddi-org:types";
ClassificationScheme uddiOrgTypes =
bqm.findClassificationSchemeByName(null, schemeName);
/*
* Create a classification, specifying the scheme
* and the taxonomy name and value defined for WSDL
* documents by the UDDI specification.
*/
Classification wsdlSpecClassification =
blcm.createClassification(uddiOrgTypes, "wsdlSpec",
"wsdlSpec");
Collection<Classification> classifications =
new ArrayList<Classification>();
classifications.add(wsdlSpecClassification);
// Find concepts
BulkResponse br = bqm.findConcepts(null, null,
classifications, null, null);
To narrow the search, you could use other arguments of the
findConcepts
method (search qualifiers, names, external identifiers, or external links).
The next step is to go through the concepts, find the WSDL documents they cor-
respond to, and display the organizations that use each document:
// Display information about the concepts found
Collection specConcepts = br.getCollection();
Iterator iter = specConcepts.iterator();
if (!iter.hasNext()) {
System.out.println("No WSDL specification concepts found");
} else {
while (iter.hasNext()) {
Concept concept = (Concept) iter.next();
String name = getName(concept);
Collection links = concept.getExternalLinks();
System.out.println("\nSpecification Concept:\n\tName: " +
name + "\n\tKey: " + concept.getKey().getId() +
"\n\tDescription: " + getDescription(concept));
if (links.size() > 0) {
ExternalLink link =