Using HTTP or SOAP to Get Information from MySQL

Several processes are defined that show how to get information from MySQL and Sakila, which is a sample database (included with MySQL) that has default schemas and tables.

Before you begin

Ensure to install JDBC Drivers for Design time and Run time.

For more information about a JDBC Connection shared resource, see the "JDBC Connection" section in the TIBCO ActiveMatrix BusinessWorks™ Bindings and Palettes Reference guide.

    Procedure
  1. In the samples directory, select palette > http > MultiEndpointApp and double-click tibco.bw.sample.palette.http.MultiEndpointApp. For more information, see Accessing Samples.
  2. In Project Explorer expand the tibco.bw.sample.palette.http.MultiEndpointApp project.
  3. Fully expand the Resources directory and then double-click HTTPConnectorResource.httpConnResource. Verify that the Host and Port values are correct.
  4. Double-click JDBCConnectionResource.jdbcResource and verify the database connection properties. Click the Test Connection button to verify your database configuration.
  5. Fully expand the Processes directory and double-click ActorService.bwp, FilmService.bwp, or SakilaService.bwp.
  6. Click Run > Debug Configurations.
  7. At the left hand tree of Debug Configuration wizard, expand BusinessWorks Application and select BWApplication.
  8. Click the Applications tab and then click the Deselect All button if you have multiple applications. Select the checkbox next to tibco.bw.palette.http.MultiEndpointApp.application.
  9. Click Debug.
    This runs the sample in Debug mode.
  10. Click the Terminate icon to stop the process.
Result

Actor Name: CUBA OLIVIER

Film Title: ALIEN CENTERDescription: A Brilliant Drama of a Cat And a Mad Scientist who must Battle a Feminist in A MySQL Convention CUBA OLIVIER

Understanding the Configuration

Three processes are defined:

  • ActorService Process: contains the HTTP Receiver requests the input query to retrieve actor information using JDBC Query Activity. The response is provided back to HTTP Response activity.
  • FilmService Process: this process has logic similar to the ActorServer process to fetch film information using the JDBC Query activity.
  • SakilaService Process: returns the actor information using the SOAP service, which invokes a JDBC Query and returns the result.