Configuring Liberty for Bluemix Watson services

Use the IBM® Bluemix® utility command-line integration tool to configure your on-premise Liberty server to use Bluemix Watson™ services.

Before you begin

Before you configure your Liberty server to any Bluemix service, you must create an account. See Sign up for IBM Bluemix to create your Bluemix account.

About this task

Configure your Liberty server to use Watson services, such as Concept Insights, which is used to graph concepts based on user input text. Your application must use the Watson Developer Cloud Java™ SDK to access the Watson service. For more information, see Watson Developer Cloud Java SDK services. To learn more about Concept Insights, see Concept Insights. For more information about Watson, see Watson services.

Procedure

  1. Log in using the bluemixUtility login command. After your initial login, you do not have to complete this step again.
  2. Run the bluemixUtility marketplace command to list details about all the Bluemix services that can be used with the command-line utility. See the following example of the Concept Insights description:
    Service: concept_insights 
    Description: Explore the concepts behind your input, identifying associations beyond traditional text matching. 
    Documentation: https://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/concept-insights.html 
    Plans: standard
  3. Note: If you already created an instance, skip to step 4. You can also create an instance from the Bluemix dashboard.
    Run the bluemixUtility createService [options] serviceType servicePlan serviceName command to create an instance of the service that you want to use. You can choose a unique serviceName for your service instance. See the following example of the Concept Insights service:
    $ bluemixUtility createService concept_insights standard myWatsonService
  4. Optional: Run the bluemixUtility listServices command to view the Name, Type, and Plan of all the service instances that you created. See the following example:
    myWatsonService concept_insights standard
  5. Run the bluemixUtility import myWatsonService command to import the configuration.
    1. Accept the license terms and conditions of the necessary libraries that are needed to access the service.
    2. After the configuration is successfully imported, complete any additional steps to use the imported configuration in your application, such as adding a classloader reference to the library. The classloader element must be added to each application that is using the service. The classloader reference ID is different from each unique Watson service. For example, you must add the following classloader reference to your application to use the Watson Java SDK libraries.
      <application id="myWatsonApp">
                      <classloader commonLibraryRef="concept_insights-library"/>
              </application>
  6. Optional: Run the bluemixUtility listImports command to view the service configurations that you imported.
    The following IBM Bluemix service configurations have been imported:
    myWatsonService
  7. Run the bluemixUtility bind [options] serverName serviceName to bind the configuration to a Liberty server. See the following example and description of a service listed:
    $ bluemixUtility bind defaultServer myWatsonService
    
    Checking if features required for the myWatsonService are installed.
    All required features are installed.
    The myWatsonService is now bound to defaultServer server.

Results

You can now use Watson services with your Liberty server.

Icon that indicates the type of topic Task topic



Timestamp icon Last updated: Monday, 5 December 2016
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-libcore-mp&topic=twlp_config_blmx_watson
File name: twlp_config_blmx_watson.html