Web Service Development in TIBCO is one of the basic thing that almost every TIBCO developer has to do. Integrating applications through Web Service Interfaces is a common practice in almost every organization in order to comply with SOA standards.
Developing SOAP Web Service in TIBCO is not a tough job. TIBCO Designer tools make it easy to expose or consume web services in a convenient way without going into the hassle of writing complex code.
This tutorial will guide you step by step how to develop a SOAP web service in TIBCO designer. Web service that we will be developing in this tutorial will expose one function employeeDetails. This function will be exposed in a WSDL and users will be able to get all details about an employee based on employee code.
Step 1: Create New Project:
Create a new project in TIBCO designer. Name it whatever you like. I named it as SOAPTest in the example
Step 2: Create Folders For Proper Organization:
In order to organize components better, create separate folders for Processes, Connections, Schemas, Services etc as shown below:
Step 3:Create JBDC and HTTP Connections
Our web service operation will be fetching all details about employee from Oracle database. So we need to create a JDBC Connection in our Connections folder. Specify, host, IP, SID, User, Password, driver etc for the connection. Once you are sure all required information is populated, use Test Connection button to test the JDBC connection.
We also need to create a HTTP Connection in the same directory which will be used in Endpoint URL of our web service.
Step 4: Create XML Schema for Input and Output:
Our web service will receive Employee Code as input and will return Employee details as output. We need to create two schemas (XSD files) for this:
Request Schema for our web service will be like below:
Response schema which specifies our web service output structure will like this:
Step 5 : Create WSDL in TIBCO
There are two ways to generate a web service in TIBCO:
- Generating Web Service from Process
- Generating Web Service from WSDL
In our case, we will be following second approach. We will create a WSDL in TIBCO and then will generate web service from this wsdl.
Double click on EmployeeWSDL and create a PortType. I named it as EmployeeMgr:
Now we need to create Message components which are used to specify type of information being exchanged by our web service. We will create one message for input and one message for output. We will use our Request and Response schemas in these Message components.
Below is the Input Message for our WSDL:
Below is output Message for our WSDL:
Double click on PortyType and then create operation in it. I named operation as EmployeeDetails. This will be the only operation exposed in our Web service. In configuration of our operation, we specify input and output messages that we just created.
Step 6: Create Business Process for Web Service:
Once we have our WSDL ready with all required schemas, connections etc. we need to create our business process which will be doing the actual job. In our case, we will have a process which will fetch employee details from Oracle database table based on Employee Code. Our database table has following information:
In Processes folder, I created a business process and I named it as EmployeeDetails. Process looks as below:
This is a simple process with only three activities.
- Start Activity
This activity will be our process starter. In confugration Start activity, input WSDL message (that we created earlier in step 5) is specified.
- JDBC Query Acitivity:
JDBC query activity is used to query Employee details from database. This activity is named as QueryEmployee in our process. We specify database query in its configurations.
We have to pass Employee code as parameter in input mapping of this JDBC query activity. Employee code that we receive as input in start activity will be used as input here.
- End Activity:
In End activity configurations, we specify out output WSDL message. Our web service operation outputs are based on the WSDL message specified here.
Values returned as result of JDBC query are mapped to inputs of End activity which are returned to the source calling this service.
After configuring all activities in the process, validate process to make sure it has no errors.
Step 7: Create Web Service from WSDL in TIBCO Designer:
Once we have all our processes, WSDLs and other required components ready, its time to generate web service from WSDL. We can generate web service from WSDL as below:
It will ask you to specify Transport and Location to save the service. In transport, specify the HTTP connection that we created. For location, use Services folder that was created in Step 2.
After your service is created in given folder, double click it and then give some meaningful name to its Endpoint and also Endpoint URI:
From the configuration of service, you can use Save WSDL button to save WSDL file in your computer’s local directory structure.
Wow, great!!!! You are now done with all the steps to create a SOAP Web Service in TIBCO designer. Now we will be testing this service.
Step 8: Test SOAP Web Service in Tibco Designer and SOAP UI:
For testing our service, we will use TIBCO Designer Tester and a tool called SOAP UI. We will start our service in Designer Tester and then consume it using SOAP UI:
Open SOAP UI and give it WSDL path that you just saved in Step 7. It will create Request for our Web service operation EmployeeDetails. Give required input (in our case only EmployeeCode) and then press Submit Request Button:
Wonderful!! Our service is successfully consumed and we got required output. Enjoy 🙂