Instructions for running the service discovery sample

This topic describes the steps required to run the service discovery sample.

About this task

To run the service discovery sample, perform the following actions:

Note: The <WSRR_HOME>\samples directory also contains a file called HTTPDiscoverer.zip. This is a project interchange file containing the service discovery sample code in a pre-configured project, that you can load into an IBM® Rational® development environment and use as a basis for developing your own custom service discoverer.

Procedure

  1. Load the service discovery sample .jar file.
    1. Open the WSRR web UI.
    2. Switch to the Configuration perspective if necessary, by selecting Configuration in the Perspective list and clicking Go.
    3. Click Active Configuration Profile > Plug-ins > JARs.
    4. Click Load JAR plug-in.
    5. Click Browse and navigate to <WSRR_HOME>\samples. <WSRR_HOME> is the directory in which the WSRR files are installed.
    6. Select HTTPDiscoverer.jar and click Open.
    7. Enter HTTPDiscoverer for the Plug-in JAR configuration item name and click OK.
  2. Add the sample configuration to the service discovery configuration XML file.
    1. Click Active Configuration Profile > Plug-ins > Service Discovery.
    2. Click the ServiceDiscoveryConfiguration item and select the Content tab.
    3. Insert the following before the closing </service-discovery> element at the end of the file.

      Specify your own WSDL URLs inside the <configuration> element. You can specify as many WSDL URLs as you want.

      <discovery-task name="SampleDiscoveryTask">
        <discoverer type="HTTP"> 
          <discovererClass>
            com.ibm.sr.servicediscovery.http.HTTPServiceDiscoverer
          </discovererClass>
          <parserClass>
            com.ibm.sr.servicediscovery.http.HTTPParser
          </parserClass>
          <validatorClass>
            com.ibm.sr.servicediscovery.http.HTTPConfigurationValidator
          </validatorClass>
        </discoverer>
        <configuration> 
          <url>specify your first WSDL URL here</url>
          <url>Specify your second WSDL URL here</url>
        </configuration>
      </discovery-task>
    4. Click OK.
  3. Add the sample service discovery task to the scheduler configuration.

    You add the sample service discovery task to the scheduler configuration so that the task can be run. In these sample instructions, you run the task manually, but if you change the value of the <enabled> element to true, you can schedule the task to run automatically.

    1. Click Active Configuration Profile > Plug-ins > Scheduler.
    2. Click the ServiceDiscoveryScheduler item and select the Content tab.
    3. Insert the following before the closing </scheduler-configuration> element at the end of the file:
      <scheduler-task name="SampleDiscoveryTask">
        <type>Timed</type>
        <interval>60</interval>
        <class>com.ibm.sr.servicediscovery.ServiceDiscoveryTask</class>
        <enabled>false</enabled>
        <startTimeOffset>1</startTimeOffset>
        <intervalGranularity>minutes</intervalGranularity>
        <transactionality>None</transactionality>
      </scheduler-task>
    4. Click OK.
  4. Run the sample service discovery task.
    1. Open a command window and navigate to the <WSRR_HOME>\admin\scripts_cell directory.
    2. Enter the following command.
      <WAS_INSTALL_ROOT>\bin\wsadmin -f executeSchedulerTaskImmediate.jacl 
      -cell <CELLNAME> -node <NODENAME> 
      -server <SERVERNAME> -taskname SampleDiscoveryTask
      • Enter the command on one line.
      • <WAS_INSTALL_ROOT> is the root of your WebSphere® Application Server installation directory.
      • Replace <CELLNAME>, <NODENAME>, and <SERVERNAME> with the correct values:
  5. Verify that the services have been discovered.
    1. In the WSRR web UI, switch to the Administrator perspective, by selecting Administrator in the Perspective list and clicking Go.
    2. Click Business Metadata > Concepts.
    3. Click the TestInterface_TESTApplication item to display its details. Note that it is classified as an Enterprise Application. The sample service discoverer creates this Enterprise Application as a container for the services that it discovers.
    4. Click the name of one of the modules under Relationships > Modules. You should see one module for each of the URLs in your sample service discovery configuration. The sample service discoverer adds a module to the Enterprise Application for each service that it discovers. The details view for the module opens.
    5. Click the name of the WSDL document corresponding to your WSDL URL under Relationships > WSDL Documents. The WSDL document details view opens.
    6. Examine the content displayed in the Content tab to verify that the WSDL document has been loaded.