Service Registry 3.1 Developer's Guide

Creating Services by Publishing WSDL Files

An ebXML Registry includes an XML content cataloging service. This means that when you publish certain kinds of files as ExtrinsicObject objects, the registry creates other kinds of objects. The most important use of this capability is the creation of Service objects from WSDL files.

If you publish a WSDL file as an ExtrinsicObject, the cataloging service creates one or more services and service bindings, along with additional ExtrinsicObject objects, based on the content of the WSDL file.

To publish a Service based on a WSDL file, create an ExtrinsicObject as described in Creating Extrinsic Objects. 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");

The constant that represents this value is CanonicalConstants.CANONICAL_OBJECT_TYPE_ID_WSDL. However, the interface for WSDL object type concepts is org.freebxml.omar.common.profile.ws.wsdl.CanonicalConstants, not org.freebxml.omar.common.CanonicalConstants.

After you publish the WSDL file, you will find in the Registry a service and service binding that correspond to the service and portType elements of the WSDL file, along with additional ExtrinsicObject objects of type Binding and PortType.


Note –

To publish a WSDL file that contains imports or includes of other WSDL and/or XML Schema files, you must package all the files in a zip file and publish the zip file as an ExtrinsicObject with the object type that of the WSDL concept and the mime type "application/zip".


When you remove a service from the Registry, the service bindings are also removed. However, the extrinsic objects associated with the service are not removed. Similarly, if you remove an extrinsic object and its WSDL file from the Registry and repository, the service associated with them is not removed.

Creating a Service by Publishing a WSDL File: Example

For an example of creating a service by publishing a WSDL file, see JAXRPublishService.java in the directory INSTALL/registry-samples/publish-service/src. This example publishes a simple WSDL file named MyCoffeeService.wsdl.

ProcedureTo Run the JAXRPublishService Example

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

  2. Type the following command:


    Ant-base/ant run