background image

response.getExceptions() Method

<< WSDL document | Removing Data from the Registry >>
<< WSDL document | Removing Data from the Registry >>
192
J
AVA
API
FOR
XML R
EGISTRIES
concept from the response returned by the
saveConcepts
method; you use a
code sequence very similar to that of finding the key for a saved organization.
String conceptKeyId = null;
Collection concExceptions = concResponse.getExceptions();
Key concKey = null;
if (concExceptions == null) {
System.out.println("WSDL Specification Concept saved");
Collection keys = concResponse.getCollection();
Iterator keyIter = keys.iterator();
if (keyIter.hasNext()) {
concKey = (Key) keyIter.next();
conceptKeyId = concKey.getId();
System.out.println("Concept key is " + conceptKeyId);
}
}
Then you can call the
getRegistryObject
method to retrieve the concept from
the registry:
Concept specConcept =
(Concept) bqm.getRegistryObject(conceptKeyId,
LifeCycleManager.CONCEPT);
Next, you create a
SpecificationLink
object for the service binding and set the
concept as the value of its
SpecificationObject
:
SpecificationLink specLink =
blcm.createSpecificationLink();
specLink.setSpecificationObject(specConcept);
binding.addSpecificationLink(specLink);
Now when you publish the organization with its service and service bindings,
you have also published a link to the WSDL document. Now the organization
can be found via queries such as those described in Finding Organizations by
Classification (page 183).
If the concept was published by someone else and you don't have access to the
key, you can find it using its name and classification. The code looks very similar
to the code used to search for a WSDL document in Finding Organizations by