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.
Prerequisites
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
Result
The expected outcome for the file identified in the OUTPUT_FILE property is:
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
- 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.
There are corresponding clients for sending HTTP requests and invoking the SOAP service created in ActiveMatrix BusinessWorks 5.x and ActiveMatrix BusinessWorks 6.x.
- Extract the ActiveMatrix BusinessWorks 5.x project tibco.bw.palette.http.MultiEndpointApp.bw5client.zip into a folder and open the project in TIBCO Designer.
- Update the Shared Resource configurations for JDBC and HTTP:
- If you change the HTTPConnector.httpConnResource Host name or Port in the ActiveMatrix BusinessWorks 6.x project, then update the same in the ActiveMatrix BusinessWorks 5.x client activities (Send HTTP Request and SOAP Request Reply) configuration.
- If you have made any change in WSDL operations or schema used in WSDL, you must regenerate the concrete WSDL for the Sakila service and then import the WSDL in the ActiveMatrix BusinessWorks 5.x client project SOAP Request Reply activity.
- You can run the client to invoke the endpoints exposed in the ActiveMatrix BusinessWorks 6.x project in the following three ways:
- Use ActiveMatrix BusinessWorks 5.x to trigger the jobs.
- Use localhost:13001/actor/getActor/? id=15 and localhost:13001/film/getFilm/?id=15, to send HTTP requests from your browser for the ActorService and FilmService processes respectively. To send SOAP requests use the generated concrete WSDL in ActiveMatrix BusinessWorks 6.x project in a third party SOAP client such as SOAPUI.
- Run the ActiveMatrix BusinessWorks 6.x project as it has the designed Client process.