Service Registry 3 2005Q4 Developer's Guide

Using an Extrinsic Object in a Specification Link

You can publish an ExtrinsicObject by itself, but it is also a common practice to create an ExtrinsicObject to use as the specificationObject attribute of a SpecificationLink for a ServiceBinding object (see Creating Services and Service Bindings). The ExtrinsicObject typically refers to a WSDL file.

  1. Create a SpecificationLink object.

  2. Store the WSDL document in the repository and create an ExtrinsicObject that refers to it. Set the extrinsic object’s type to WSDL and its MIME type to text/xml.

  3. Specify the extrinsic object as the specificationObject attribute of the SpecificationLink object.

  4. Add the SpecificationLink object to the ServiceBinding object.

  5. Add the ServiceBinding object to the Service object.

  6. Save the Service object.

After you create a Service and ServiceBinding, create a SpecificationLink:


SpecificationLink specLink = blcm.createSpecificationLink();
specLink.setName("Spec Link Name");
specLink.setDescription("Spec Link Description");

Create an ExtrinsicObject as described in Creating an Extrinsic Object. Use the ID for the WSDL concept and the text/xml MIME type.


String conceptId =
"urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:ExtrinsicObject:WSDL";
Concept objectTypeConcept =
     (Concept) bqm.getRegistryObject(conceptId);
((ExtrinsicObjectImpl)eo).setObjectType(objectTypeConcept);
eo.setMimeType("text/xml");

Set the ExtrinsicObject as the specification object for the SpecificationLink:


specLink.setSpecificationObject(eo);

Add the SpecificationLink to the ServiceBinding, then add the objects to their collections and save the services.


binding.addSpecificationLink(specLink);
serviceBindings.add(binding);
...

When you remove a service from the Registry, the service bindings and specification links are also removed. However, the extrinsic objects associated with the specification links are not removed.

Creating an Extrinsic Object for Use in a Specification Link: Example

For an example of creating an extrinsic object to use in a specification link, see JAXRPublishService.java in the directory <INSTALL>/registry/samples/publish-service/src. This example publishes a WSDL file to the Registry.

ProcedureTo Run the JAXRPublishService Example

Steps
  1. Go to the directory <INSTALL>/registry/samples/publish-service.

  2. Type the following command:


    asant run