Service Registry 3.1 Developer's Guide

Adding Services to an Organization

Most organizations publish themselves to a registry to offer services, so JAXR has facilities to add services to an organization. Typically, you first create the service by publishing a WSDL file (see Creating Services by Publishing WSDL Files). Then you add the service to the organization.

Like an Organization object, a Service object has a name, a description, and a unique key that is generated by the Registry when the service is registered. A Service object can also have classifications.

In addition to the attributes common to all objects, a service also commonly has service bindings, which provide information about how to access the service. A ServiceBinding object normally has a description and an access URI,.

The following code fragment shows how to locate a previously published service and add it to the organization. This example uses the service published in Creating a Service by Publishing a WSDL File: Example.

String serviceId = "urn:Foo:service:MyCoffeeService";
Service service = (Service) bqm.getRegistryObject(serviceId);
System.out.println("Service URN is " + serviceId);

Collection services = new ArrayList();
services.add(service);
org.addServices(services);