Red Hat Training

A Red Hat training course is available for JBoss Enterprise SOA Platform

Chapter 9. Configure the Service Registry

9.1. Service Registry

A service registry is a central database that stores information about services, notably their end-point references. The default service registry for the JBoss Enterprise SOA Platform is jUDDI (Java Universal Description, Discovery and Integration). Most service registries are designed to adhere to the Universal Description, Discovery and Integration (UDDI) specifications.
From a business analyst’s perspective, the registry is similar to an Internet search engine, albeit one designed to find web services instead of web pages. From a developer's perspective, the registry is used to discover and publish services that match various criteria.
In many ways, the Registry Service can be considered to be the "heart" of the JBoss Enterprise SOA Platform. Services can "self-publish" their end-point references to the Registry when they are activated and then remove them when they are taken out of service. Consumers can consult the registry in order to determine which end-point reference is needed for the current service task.

9.2. jUDDI Registry

The jUDDI (Java Universal Description, Discovery and Integration) Registry is a core component of the JBoss Enterprise SOA Platform. It is the product's default service registry and comes included as part of the product. In it are stored the addresses (end-point references) of all the services connected to the Enterprise Service Bus. It was implemented in JAXR and conforms to the UDDI specifications.

9.3. jUDDI and the JBoss Enterprise SOA Platform

jUDDI and the JBoss Enterprise SOA Platform

The JBoss Enterprise SOA Platform product includes a pre-configured installation of a jUDDI registry. You can use a specific API to access this registry through your custom client. However, any custom client that you build will not covered by your SOA Platform support agreement. You can access the full set of jUDDI examples, documentation and APIs from: http://juddi.apache.org/.

9.4. Other Supported Service Registries

The JBoss Enterprise SOA Platform also supports these other UDDI registries:
  • SOA Software SMS
  • HP Systinet

9.5. Universal Description, Discovery and Integration (UDDI) Registry

The Universal Description, Discovery and Integration Registry (UDDI) is a directory for web services. Use it to locate services by running queries through it at design- or run-time. Within an UDDI Registry, information is categorized in Pages. UDDI creates a standard interoperable platform that enables companies and applications to quickly, easily, and dynamically find and use Web services over the Internet. UDDI also allows operational registries to be maintained for different purposes in different contexts.
The UDDI also allows providers to publish descriptions of their services. The typical UDDI Registry will contain a uniform resource locator (URL) that points to both the WSDL document for the web services and the contact information for the service provider.
A business publishes services to the UDDI registry. A client looks up the service in the registry and receives service binding information. The client then uses the binding information to invoke the service. The UDDI APIs are SOAP-based for interoperability reasons.

9.6. UDDI Page Types

Green Pages
Green Pages provide information that enables you to bind a client to the service being provided.
Yellow Pages
Yellow Pages are used to categorize businesses based upon the industries to which they belong.
White Pages
White Pages contain general information, such as the name, address and other contact details for the company providing the service.

9.7. The Service Registry and the JBoss Enterprise SOA Platform

The Service Registry is a key part of the JBoss Enterprise SOA Platform. When you deploy services to SOA Platform's ESB, their end-point references are stored in it.

9.8. jUDDI and the ESB

The JBoss Enterprise Service Bus directs all interaction with the Registry through the registry interface, the default version of which uses Apache Scout.

9.9. How the Registry Works

  1. The JBoss Enterprise Service Bus funnels all interaction with the Registry through the registry interface.
  2. It then calls a JAXR implementation of this interface.
  3. The JAXR API needs to utilize a JAXR implementation. (By default, this is Apache Scout.)
  4. Apache Scout, in turn, calls the Registry.

9.10. Apache Scout

Apache Scout is an open source implementation of JAXR, created by the Apache Project.
There are currently four implementations of the org.jboss.soa.esb.scout.proxy.transportClass class, one each for SOAP, SAAJ, RMI and Embedded Java (Local).

9.11. Java API for XML Registries (JAXR)

Java API for XML Registries (JAXR) is an API that provides a standard way to develop for service registries.

9.12. Registry Interface

The Registry Interface is the means by which the ESB communicates with the Service Registry.

9.13. Configuring the Registry

Introduction

Normally, you will automatically configure the jUDDI Registry when you run the Database Configuration Tool.

Read this section for advanced options on manually configuring it.

9.14. Configure the Registry Manually

Procedure 9.1. Task

  1. Open the global configuration file in a text editor: vi SOA_ROOT/jboss-as/server/PROFILE/deployers/esb.deployer/jbossesb-properties.xml.
  2. Scroll down to the "registry" section and alter the settings as you wish.
    <properties name="registry">
      <property name="org.jboss.soa.esb.registry.implementationClass"
        value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
      
      <property name="org.jboss.soa.esb.registry.factoryClass"
        value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
      
      <property name="org.jboss.soa.esb.registry.queryManagerURI"
        value="org.apache.juddi.v3.client.transport.wrapper.UDDIInquiryService#inquire"/>
      
      <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI"
        value="org.apache.juddi.v3.client.transport.wrapper.UDDIPublicationService#publish"/>
      <property name="org.jboss.soa.esb.registry.securityManagerURI"
        value="org.apache.juddi.v3.client.transport.wrapper.UDDISecurityService#secure"/>
      
      <property name="org.jboss.soa.esb.registry.user" value="root"/>
      <property name="org.jboss.soa.esb.registry.password"	value="root"/>
      
      <property name="org.jboss.soa.esb.scout.proxy.uddiVersion" value="3.0"/>
      <property name="org.jboss.soa.esb.scout.proxy.uddiNameSpace" value="urn:uddi-org:api_v3"/>
      
      <property name="org.jboss.soa.esb.scout.proxy.transportClass"
        value="org.apache.ws.scout.transport.LocalTransport"/>
      <!-- specify the interceptors, in order -->
      <property name="org.jboss.soa.esb.registry.interceptors"
      value="org.jboss.internal.soa.esb.services.registry.InVMRegistryInterceptor, org.jboss.internal.soa.esb.services.registry.CachingRegistryInterceptor"/>
      <!-- The following properties modify the cache interceptor behaviour -->
      <property name="org.jboss.soa.esb.registry.cache.maxSize" value="100"/>
      <property name="org.jboss.soa.esb.registry.cache.validityPeriod" value="600000"/>
      
      <!-- Organization Category to be used by this deployment. -->
      <property name="org.jboss.soa.esb.registry.orgCategory"         
      value="org.jboss.soa.esb.:category"/>
    </properties>
    
  3. Save the file and exit.

9.15. Table of Registry Configuration Options

Table 9.1. Registry Properties

Property Description
org.jboss.soa.esb.registry.implementationClass
This is a class that implements the JBoss ESB Registry interface. One implementation, JAXRRegistryImpl, is included. It uses the JAXRRegistry interface.
org.jboss.soa.esb.registry.factoryClass
This is the class name of the JAXR ConnectionFactory implementation.
org.jboss.soa.esb.registry.queryManagerURI
This is the URI used by JAXR to query services.
org.jboss.soa.esb.registry.lifeCycleManagerURI
This the URI that JAXR uses for editing.
org.jboss.soa.esb.registry.user
This is the username utilized for editing.
org.jboss.soa.esb.registry.password
This is the password for the specified user.
org.jboss.soa.esb.scout.proxy.uddiVersion
This is the UDDI version of the query.
org.jboss.soa.esb.scout.proxy.uddiNameSpace
This is the UDDI namespace.
org.jboss.soa.esb.scout.proxy.transportClass
This is the class used by Apache Scout to send items to the UDDI Registry.
org.jboss.soa.esb.registry.interceptors
This is the list of interceptors that are applied to the Registry. The ESB provides two interceptors, one for handling InVM registrations and one that supplies the Registry with a cache.
The default interceptor list contains only one entry, that for the InVM interceptor.
org.jboss.soa.esb.registry.cache.maxSize
This is the maximum number of server entries allowed in the cache. If this value is exceeded, entries will be removed on a "Least Recently Used" basis. The default value is 100.
org.jboss.soa.esb.registry.cache.validityPeriod
This is the period of validity that has been set for the caching interceptor. The value is specified in milliseconds and defaults to 600000 (ten minutes). Set this value to 0 to if you do not wish the cache to expire.
org.jboss.soa.esb.registry.orgCategory
This is the name of the ESB's organization category. The default is org.jboss.soa.esb.:category.

9.16. Registry Configuration Use Cases

Here are some cases where a user would want to configure the registry manually:
  • To change the queryManagerURI/lifeCycleManagerURI/securityManagerURI to match the locations of a UDDI registry.
  • To change the registry user/password.
  • To provide a custom org.jboss.soa.esb.registry.orgCategory
  • To specify custom registry interceptors

9.17. Embedding the Registry

If you want the server components to share a single jUDDI Registry, you should embed it. This method even allows multiple instances of the JBoss Enterprise SOA Platform itself to share the same registry.

9.18. Embed the Registry

Procedure 9.2. Task

  1. Open the global configuration file in a text editor: vi SOA_ROOT/jboss-as/server/PROFILE/deployers/esb.deployer/jbossesb-properties.xml.
  2. Scroll down to the "registry" section and alter the settings like this:
    <properties name="registry">
    
    	    <property name="org.jboss.soa.esb.registry.implementationClass" 				    
    	    value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
    
    	    <property name="org.jboss.soa.esb.registry.factoryClass" 					
    	    value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
    
        	<property name="org.jboss.soa.esb.registry.queryManagerURI" 				
        	value="org.apache.juddi.registry.local.InquiryService#inquire"/>
    
        	<property name="org.jboss.soa.esb.registry.lifeCycleManagerURI" 
        	value="org.apache.juddi.registry.local.PublishService#publish"/>
    
        	<property name="org.jboss.soa.esb.registry.securityManagerURI" 
        	value="org.apache.juddi.registry.local.SecurityService#secure"/>
    
        	<property name="org.jboss.soa.esb.registry.user" value="jbossesb"/>
        	<property name="org.jboss.soa.esb.registry.password" value="password"/>
        	
        	<property name="org.jboss.soa.esb.scout.proxy.transportClass" 				                                    
        	value="org.apache.ws.scout.transport.LocalTransport"/>
    
    </properties>
    
  3. Save the file and exit.

9.19. Configuring the Registry to Use Remote Method Invocation

The Registry can be configured to utilize RMI. (The JBoss Enterprise SOA Platform deploys the remote method invocation service by default: the ESB starts the Registry within the jbossesb.sar archive and it is this same archive that also automatically registers a remote method invocation service.)

9.20. Configure the Registry to Use Remote Method Invocation

Procedure 9.3. Task

  1. Open the global configuration file in a text editor: vi SOA_ROOT/jboss-as/server/PROFILE/deployers/esb.deployer/jbossesb-properties.xml.
  2. Scroll down to the "registry" section and alter the settings like this:
    <properties name="registry">
      <property name="org.jboss.soa.esb.registry.implementationClass"
        value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
    
      <property name="org.jboss.soa.esb.registry.factoryClass"
        value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
    
      <property name="org.jboss.soa.esb.registry.queryManagerURI"
        value="jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire"/>
    
      <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI"
        value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish"/>      
      <property name="org.jboss.soa.esb.registry.securityManagerURI"
        value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish"/>
      
      <property name="org.jboss.soa.esb.registry.user" value="jbossesb"/>
      <property name="org.jboss.soa.esb.registry.password" value="password"/>
          
      <property name="org.jboss.soa.esb.scout.proxy.transportClass"
        value="org.apache.ws.scout.transport.RMITransport"/>
    </properties>
    
  3. Save the file and exit.
  4. Open the web.xml file in your text editor.
  5. Configure it like this:
    <!--  uncomment if you want to enable making calls in juddi with rmi  -->
      <servlet>
      	<servlet-name>RegisterServicesWithJNDI</servlet-name>
      	<servlet-class>org.apache.juddi.registry.rmi.RegistrationService</servlet-class>
      	<load-on-startup>1</load-on-startup>
      </servlet>
    
  6. Save the file and exit.
  7. Open the jUDDI configuration file in a text editor: vi SOA_ROOT/jboss-as/server/standard/deploy/juddi-service.sar/juddi.war/WEB-INF/juddi.properties.
  8. Configure it like this:
    # JNDI settings (used by RMITransport)
    java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
    java.naming.provider.url=jnp://localhost:1099
    java.naming.factory.url.pkgs=org.jboss.naming
    
  9. Save the file and exit.
  10. Add scout-client.jar to the RMI client's class-path.

9.21. Remote Method Invocation Using a Custom JNDI Registration of the RMI Service

If, for some reason, you do not want to deploy the juddi.war archive, you can configure one of the Enterprise Service Bus components running in the same Java Virtual Machine as the jUDDI Registry to register the RMI service.

9.22. Configure RMI Using Your Own JNDI Registration

  1. For a local application, open the global configuration file in a text editor: vi SOA_ROOT/jboss-as/server/PROFILE/deployers/esb.deployer/jbossesb-properties.xml.
  2. Scroll down to the "registry" section and alter the local settings like this:
    <properties name="registry">
    	<property name="org.jboss.soa.esb.registry.implementationClass" 
    value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
    
    	<property name="org.jboss.soa.esb.registry.factoryClass"
    value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
    
        	<property name="org.jboss.soa.esb.registry.queryManagerURI"
    value="org.apache.juddi.registry.local.InquiryService#inquire"/>
    
        	<property name="org.jboss.soa.esb.registry.lifeCycleManagerURI"
    value="org.apache.juddi.registry.local.PublishService#publish"/>
    
        	<property name="org.jboss.soa.esb.registry.securityManagerURI"
    value="org.apache.juddi.registry.local.SecurityService#secure"/>
    
        	<property name="org.jboss.soa.esb.registry.user" value="jbossesb"/>
        	<property name="org.jboss.soa.esb.registry.password" value="password"/>
        	
        	<property name="org.jboss.soa.esb.scout.proxy.transportClass" 
    value="org.apache.ws.scout.transport.LocalTransport"/>
    </properties>
    
  3. Save the file and exit.
  4. For a remote application, open the global configuration file in a text editor: vi SOA_ROOT/jboss-as/server/PROFILE/deployers/esb.deployer/jbossesb-properties.xml.
  5. Scroll down to the "registry" section and alter the remote method invocation settings like this:
    <properties name="registry">
    	<property name="org.jboss.soa.esb.registry.implementationClass"
    value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
    
    	<property name="org.jboss.soa.esb.registry.factoryClass"
    value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
    
        	<property name="org.jboss.soa.esb.registry.queryManagerURI"
    value="jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire"/>
    
        	<property name="org.jboss.soa.esb.registry.lifeCycleManagerURI"
    value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish"/>
    	
        	<property name="org.jboss.soa.esb.registry.user" value="jbossesb"/>
        	<property name="org.jboss.soa.esb.registry.password" value="password"/>
        	
        	<property name="org.jboss.soa.esb.scout.proxy.transportClass"
    value="org.apache.ws.scout.transport.RMITransport"/>
    </properties>
    
  6. Save the file and exit.
  7. Point the host names of the queryManagerURI and lifeCycleManagerURI classes to the host on which the jUDDI Registry is running (this is also where the local is running). Note that the local application needs to have access to a naming service.
  8. Use these settings to register the application:
    //Getting the JNDI setting from the config
    Properties env = new Properties();
    env.setProperty(RegistryEngine.PROPNAME_JAVA_NAMING_FACTORY_INITIAL,factoryInitial);
    env.setProperty(RegistryEngine.PROPNAME_JAVA_NAMING_PROVIDER_URL, providerURL);
    env.setProperty(RegistryEngine.PROPNAME_JAVA_NAMING_FACTORY_URL_PKGS,
      factoryURLPkgs); 
    
    InitialContext context = new InitialContext(env);
    Inquiry inquiry = new InquiryService();
    log.info("Setting " + INQUIRY_SERVICE + ", " + inquiry.getClass().getName());
    mInquery = inquiry;
    context.bind(INQUIRY_SERVICE, inquiry);
    Publish publish = new PublishService();
    log.info("Setting " + PUBLISH_SERVICE + ", " + publish.getClass().getName());
    mPublish = publish;
    context.bind(PUBLISH_SERVICE, publish);
    
  9. Include the scout-client.jar file on the RMI client's class-path.

9.23. Communicate with the jUDDI Registry via SOAP

You can make the Enterprise Service Bus communicate with the jUDDI Registry by using SOAP (via Apache Scout).

9.24. Simple Object Access Protocol (SOAP)

Simple Object Access Protocol (SOAP) is a lightweight protocol that enables the user to define the content of a message and to provide hints as to how recipients should process that message. SOAP is an XML-based communication protocol.

9.25. Configure Apache Scout to Use SOAP

Procedure 9.4. Task

  1. Shut down the RMI service by "commenting out" the web.xml file's RegisterServicesWithJNDI servlet.
  2. Deploy the juddi.war archive.
  3. Configure the data-source.
    Here are some sample properties:
    <properties name="registry">
    	<property name="org.jboss.soa.esb.registry.implementationClass" 				
    	value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
    
    	<property name="org.jboss.soa.esb.registry.factoryClass" 					
    	value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
    
       	<property name="org.jboss.soa.esb.registry.queryManagerURI" 				
       	value="http://localhost:8080/juddi/inquiry"/>
    
       	<property name="org.jboss.soa.esb.registry.lifeCycleManagerURI" 				
       	value="http://localhost:8080/juddi/publish"/>	
    
       	<property name="org.jboss.soa.esb.registry.user" value="jbossesb"/>
       	<property name="org.jboss.soa.esb.registry.password" value="password"/>
       	
       	<property name="org.jboss.soa.esb.scout.proxy.transportClass" 				
       	value="org.apache.ws.scout.transport.AxisTransport"/>
    </properties>
    

9.26. jUDDI Console

The jUDDI Console is a web-based graphical interface that you must use in order to configure the jUDDI Registry. It is accessible at http://localhost:8080/uddi-console/.

9.27. Grant Access to the jUDDI Console

Prerequisites

  • A user with the name "root" who has been assigned the security roles of "user" and "admin".
You must log in as a jUDDI Publisher named root to give anyone administration rights. Once a user has these administration rights, they can grant them to other users.

Procedure 9.5. Task

  1. Open a web browser session and go to the jUDDI Console at http://localhost:8080/uddi-console/. Log in as root.
  2. Click "Publisher".
  3. From the Publisher ID list, click on the username.
  4. Select the "Is Admin" checkbox.
Result

The user you selected now has administrative rights.

9.28. Install JBoss Developer Studio Plug-Ins for SOA

Prerequisites

  • JBoss Developer Studio
  • JBDS JBoss Tools Component

Procedure 9.6. Task

  1. Launch JBoss Developer Studio
  2. Go to JBoss Central screen
  3. Download the plug-ins you require to do your SOA development work.