In one of my earlier tutorials, I taught you how to develop SOAP web service in TIBCO with HTTP as transport. Now, in this step by step tutorial, you will learn how to develop SOAP web service in TIBCO with JMS transport.
In case of JMS based SOAP web services, JMS queues are used which store messages sent over JMS transport. JMS queues are maintained on a JMS Server. For SOAP JMS Web services in TIBCO, its mandatory to have TIBCO setup at both client and server side. On the other hand, for HTTP based SOAP web services, there is no such requirement in client side.
In this TIBCO SOAP JMS tutorial, we will create a web service in TIBCO that will receive age as Input and it will return eligibility status as response. We are keeping the web service logic as simple as possible here as purpose is to explore all the steps involved in developing JMS based SOAP service and not process implementation details.
Step 1: Create JMS Connection
For a JMS based SOAP web service, the first thing that we need to do is to create a JMS connection to a JMS queue. Create a JMS connection in your project by going to Add Resources–>JMS–>JMS Connection.
Complete configuration of JMS connection will be like below:
Now in order to test our connection, we click on Test Connection button. As you can see in the screenshot below, JMS Connection is successful in my case:
Step 2: Create Schemas for JSM SOAP Web Service input and output
Our web service will receive only one input which will be age of a person. To create XSD for this, choose XML Schema from XML Palette. So our XML Schema will look like below:
For our service, response schema is also going to be simple as we will be sending just a Status message in response. Add a response schema as shown in the below screenshot:
Step 3: Create WSDL in TIBCO Designer for SOAP JMS Service
We are going to follow the “contract first” approach for creating web service in which we will create a WSDL first and then move towards service implementation.
Add a new WSDL Resource in your project and double click on it. Now we need to create WSDL Messages for Input and Output of our web service operation.
For the Request Message (to be used as Input), we choose Request XSD that was created in Step 2. Request WSDL Message will look like below:
For the response, we create another WSDL Message and name it like ResMessage. In this Message, we choose Response XSD which was also created by us in Step 3.
Our Response WSDL Message will look like below:
Now that we have created WSDL Messages, we need to create PortType. If you are aware of Object Oriented Programming, you can consider PortType as a Class which contains one or more operations.
Our PortType will be as follows:
As I earlier said, PortType is similar to a class, so we need to add operations inside it. Add a new Operation inside the PortType after double clicking on PortType.
I have given the name GetStatus to my Operation here. In the Message Table of Operation, we choose Messages for Input and Output. These messages have already been created by us.
Operation will now look like below:
With this we complete our WSDL creation step. Now we will proceed with creation of a service from WSDL in next step.
Step 4: Create Web Service from WSDL in TIBCO
In order to create web service from the WSDL, right click on the WSDL in the Project window and go to Tools or multi-User–>Generate Web Service–>From WSDL
As you can see in below screenshot, our created service will be using JMS transport:
As you can see in below screenshot, service has been created in the specified Location along with a process for the operation that we have in our service:
Change the name of the service to something meaningful (I changed the name to SOAPJMSWebService) and also move the BW Process to the Processes folder for better code organization in the project.
In the transport of the service, I have chosen JMS transport which was created in Step 1. This will use JMS queue for messaging purposes:
Now go to WSDL Source for the created web service and save the WSDL in a .wsdl file in your local file system as shown in the below screenshot:
This completes our web service creation part. Now we need to implement TIBCO BW process which is associated with our Web Service Operation GetStatus.
Step 5: Implement TIBCO BW Process for Web Service
Our process created by TIBCO Designer will be simple in this case. It will have only a Mapper activity where we will set the message to be sent as output.
In the Input Editor of Map Data activity, create a new String as shown below:
In the Input tab of Map Data activity, I have used an XPath formula that if age sent from the client is above 18, it will give the message “You are eligible”, otherwise message will be “You are not eligible”:
XPath for this is shown in screenshot below:
And in the End activity of this process, we simply map this message so that it’s sent as response when service is consumed:
Step 6: Test TIBCO JMS SOAP Web Service Using Designer Tester
Our last step in this TIBCO Web Services tutorial is to test the service that we have created. For this, we need to create a SOAP Client process in TIBCO Designer first.
Create a new process and use SOAP Request Reply activity in the process. This activity will be used to consume the web service. In the configuration of SOAPRequestReply activity, for the service, choose the WSDL that we saved in step 4. (I loaded that WSDL in another process and using it from there).
As you can see in below screenshot; Service, Port and Operations are selected from the WSDL:
In the Input tab of SOAPRequstReply activity, we have to give some input value for Age. In this example, I have given it a hard coded value 44 for test purpose:
Now load the service in designer tester. Once service is loaded, next task is to load and run the SOAP Client process that we created above. As you can see in the screenshot below, our process has run and consumed the service successfully and has received the response based on the input data:
This completes out tutorial on developing SOAP Web service in TIBCO using JMS transport. If you have any questions, I am here to answer and help you out.
You can also watch my video below about SOAP Web Services Best Practices. Don’t forget to subscribe to the channel for more updates in future:
Hi Ajmal,
Nice post. I have doubt, What is the unique difference between JMS and http transport. Which one is better? Can you please help me understanding clearly..
Thanks in advance.
Reasons to go with HTTP:
Firewall friendly (web services exposed over internet)
Supported on all platforms (easiest connectivity in b2b scenario)
Clients can be simple and lightweight
Reasons to go with JMS:
Assured delivery and/or only once delivery
Asynchronous support
Publish/subscribe
Queuing if better for achieving larger scalability and reliability
Better handles temporary high load
Large volume of messages (EDA)
Better support in middleware software
Transaction boundary
Pingback: SOAP Event Source Tutorial: How to Expose a Process as Web Service in TIBCO | TutorialsPedia
Pingback: TIBCO Web Services: Top Interview Questions and Answers | TutorialsPedia
Hi Thanks for explanation.
I want to test WSDL created from above steps.
I have done set up of hermes using soap ui.
Can you please tell me how can I proceed further?
Thanks in advance,
Nice Post, But I didn’t understand the concept of Webservice usage here. Even we can validate Age is > 18 using other pallets. Please explain me in real time scenario. Thanks
Dear Srini,
The post is meant to explain the concept and steps involved in developing SOAP JMS web service in TIBCO BW. The scenario taken is not a real time scenario however. Thanks
While running this service following error is coming data “” is not a valid int. A valid example is “-1, 0, 126789675, +100000”.Please reply for the solution
This error appears when you are not giving any input for a mandatory integer input field. Please make sure that all the input data is valid. Thanks
i’m not getting data for port and operation im SOAPRequestReply under configuration tab… plz advise
I am not able to enter in the port and operation fields. How do I go about it?
Shriya….You should just need to select the concrete WSDL in the SOAP Request Reply palette.
Hi Ajmal Hussain
I did follow this step.
When running step6 the soap request/reply is hold process.
I checked in JMS the message already put in JMS.
Look like stub process(getstatus) is not pick up message.
I checked the consoles is no any error.
Please advice.
can u please explain me the whole process how the Services are Called with SOAP reference..
Dear Sudheer,
Once you have developed your web service with the given steps; you can consume this service through any client. If you want to consume from TIBCO; you can create a simple process and use SOAP Request Reply activity to call any operation from the web service. Thanks
Hi Ajmal,
I tried above example, The request/reply activity holds for something. If I check in queue the message is put in queue.but that message is not receiving by SOAP activity. Please help me to get resolve.
HI Murali,
In tester please start the service also along with the client request reply process.
Hi Ajmal,
Can you please explain, what is the advantage of using JMS as transport instead of HTTP. And can JMS be used in all cases where http is used ? would really appreciate your response.
Thanks.
Hi Ajmal,
I am implementing the same type of example, But with SOAP UI tool.
I can see the massages are coming on queue, but its not being picked up by web service.
But, When i am using BW client process, Its working fine.
So, Can you please help me to understand the difference between SOAP UI and BW client process.
is there anything which in need to include in order to get it working with SOAP UI tool ?
Hi, I am wondering where do we initialize the reply queue for the soap action? I would assume the following:
soap request -> JMS Request Queue -> operation performed -> JMS Response Queue
Agustin
Hi There,
I love all the posts, I really enjoyed.
I would like more information about this, because it is very nice., Thanks for sharing.
I have tried many things and I cannot make an insert statement work In the query section on an IL. I can run it in the Pre-Updates section if I leave off the semicolon. However it seems that in the Pre-updates section I cannot use parameters.
Has anyone suceeded in adding an isert staement before the select in an ionformation link? I suspect a product change has made this impossible.
Once again thanks for your tutorial.
Thank you,
Preethi
how many receivers on queue if 5 operations?
Hi Ajmal,
can you give a example how to invoke State full web service in Tibco BW.
Dear Kanth,
I do have some tutorials on this site for BW REST web services. Please go through those.