Documentation Center

Configuring the location of the Discovery Service and client-side caching in a Java/JSP Web application

To enable the Discovery Service (and the Capabilities it exposes) to be found, configure the location of the Discovery Service in the client configuration file, cd_client_conf.xml.

Procedure

  1. In the configuration directory of the Role, open cd_client_conf.xml for editing.
  2. Ensure that the file contains a root-level element called ServiceConfig that looks as follows:
    <ServiceConfig
      ConnectionTimeout="TIMEOUT"
      CacheEnabled="CACHE_ENABLED"
      CacheExpirationDuration="CACHE_EXP"
      ServiceAvailabilityCheck="SERVICE_CHECK">
      <DiscoveryService ServiceUri="URI" />
      <TokenService ClientId="USERNAME" ClientSecret="PASSWORD" />
    </ServiceConfig>
    where:
    • TIMEOUT is the amount of time in milliseconds after which a connection to the Discovery Endpoint times out. A good default value would be 10000 (that is, 10 seconds); however, you may need to increase this value if your site has a large sitemap.
    • CACHE_ENABLED is true if you intend to cache information retrieved from the Discovery Endpoint. Set this to true unless you have a pressing reason to disable it.
    • CACHE_EXP is the amount of time in seconds after which the cache expires. A good default value would be 600 (that is, 600 seconds or 10 minutes).
    • SERVICE_CHECK is true if the client should check if the service is available.
    • URI is the URL of the Discovery Endpoint.
    • USERNAME and PASSWORD are valid Token Service credentials that grant the client access to the Discovery Endpoint. You can find valid credentials in the Ambient Data Framework configuration file, cd_ambient_conf.xml, of the Discovery Service. USERNAME must be a user who assumes the cd role; by default, that user is called cduser. Note also that the value of ClientSecret must be an encrypted value.