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
9.2. jUDDI Registry
9.3. 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
- SOA Software SMS
- HP Systinet
9.5. Universal Description, Discovery and Integration (UDDI) Registry
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
9.8. jUDDI and the ESB
9.9. How the Registry Works
- The JBoss Enterprise Service Bus funnels all interaction with the Registry through the registry interface.
- It then calls a JAXR implementation of this interface.
- The JAXR API needs to utilize a JAXR implementation. (By default, this is Apache Scout.)
- Apache Scout, in turn, calls the Registry.
9.10. Apache Scout
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)
9.12. Registry Interface
9.13. Configuring the Registry
Normally, you will automatically configure the jUDDI Registry when you run the Database Configuration Tool.
9.14. Configure the Registry Manually
Procedure 9.1. Task
- Open the global configuration file in a text editor:
vi SOA_ROOT/jboss-as/server/PROFILE/deployers/esb.deployer/jbossesb-properties.xml
. - 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>
- 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
- 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
9.18. Embed the Registry
Procedure 9.2. Task
- Open the global configuration file in a text editor:
vi SOA_ROOT/jboss-as/server/PROFILE/deployers/esb.deployer/jbossesb-properties.xml
. - 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>
- Save the file and exit.
9.19. Configuring the Registry to Use Remote Method Invocation
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
- Open the global configuration file in a text editor:
vi SOA_ROOT/jboss-as/server/PROFILE/deployers/esb.deployer/jbossesb-properties.xml
. - 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>
- Save the file and exit.
- Open the
web.xml
file in your text editor. - 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>
- Save the file and exit.
- 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
. - 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
- Save the file and exit.
- 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
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
- 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
. - 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>
- Save the file and exit.
- 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
. - 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>
- Save the file and exit.
- Point the host names of the
queryManagerURI
andlifeCycleManagerURI
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. - 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);
- Include the
scout-client.jar
file on the RMI client's class-path.
9.23. Communicate with the jUDDI Registry via SOAP
9.24. Simple Object Access Protocol (SOAP)
9.25. Configure Apache Scout to Use SOAP
Procedure 9.4. Task
- Shut down the RMI service by "commenting out" the
web.xml
file's RegisterServicesWithJNDI servlet. - Deploy the
juddi.war
archive. - 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
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".
Procedure 9.5. Task
- Open a web browser session and go to the jUDDI Console at http://localhost:8080/uddi-console/. Log in as root.
- Click "Publisher".
- From the Publisher ID list, click on the username.
- Select the "Is Admin" checkbox.
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
- Launch JBoss Developer Studio
- Go to JBoss Central screen
- Download the plug-ins you require to do your SOA development work.