Most organizations offer services. JAXR has methods that retrieve the services and service bindings for an organization.
A Service object has all the attributes of other registry objects. In addition, it normally has service bindings, which provide information about how to access the service. A ServiceBinding object, along with its other attributes, normally has an access URI. It can also have a specification link, which provides the linkage between a service binding and a technical specification that describes how to use the service through the service binding.
A specification link has the following attributes:
A specification object, which is typically an ExtrinsicObject
A usage description, which is an InternationalString object
A Collection of usage parameters, which are String values
You can use the Service.getProvidingOrganization method to retrieve the organization that provides a service, and you can use the ServiceBinding.getService method to retrieve the service for a service binding.
The following code fragment retrieves the services for the organization org. Then it retrieves the service bindings for each service and, for each service binding, its access URI.
Collection services = org.getServices(); Iterator svcIter = services.iterator(); while (svcIter.hasNext()) { Service svc = (Service) svcIter.next(); System.out.println(" Service name: " + getName(svc)); System.out.println(" Service description: " + getDescription(svc)); Collection serviceBindings = svc.getServiceBindings(); Iterator sbIter = serviceBindings.iterator(); while (sbIter.hasNext()) { ServiceBinding sb = (ServiceBinding) sbIter.next(); System.out.println(" Binding name: " + getName(sb)); System.out.println(" Binding description: " + getDescription(sb)); System.out.println(" Access URI: " + sb.getAccessURI()); } } }
The example Retrieving Organization Attributes: Example also displays the services and service bindings for the organizations it finds.
Services often exist independent of an organization. You can search for services directly using the BusinessQueryManagerImpl.findObjects method.