TIBCO SOAP JMS Tutorial: How to Develop JMS Based Web Service in TIBCO BW

By | April 3, 2014

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 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:

tibco soap jms create jms connection

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:

tibco soap jms test connection

 

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:

tibco soap jms service request schema

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:

tibco soap jms service response schema

 

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:

tibco soap jms service wsdl request message

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:

tibco soap jms service wsdl response message

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:

SOAP JMS Porttype

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:

tibco soap jms wsdl operation

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:

tibco soap jms create web service from wsdl

 

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:

soap jms web service created

 

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:

tibco jms web service transport configuration

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:

save soap jms wsdl source

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:

soap jms mapper input editor

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:

tibco soap jms service map data input mapping

 

And in the End activity of this process, we simply map this message so that it’s sent as response when service is consumed:

tibco soap jms service end activity wsdl mapping

 

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:

soap send request reply service

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:

soap send request reply input mapping

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:

tester soap jms web service output

 

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.

Ajmal Abbasi

Ajmal Hussain Abbasi is a TIBCO Consultant By Profession with more than 6 years experience in TIBCO products. He has extensive practical knowledge of TIBCO Business Works, TIBCO Spotfire, TIBCO BE, EMS and TIBCO ActiveSpaces. He has worked on a number of highly critical integration projects in Telecom sector by using his skills in Tibco Designer, Adapters, TIBCO EMS, RV, Administrator, TIBCO BE, TIBCO ActiveSpaces etc. Ajmal Abbasi is also experienced in developing solutions using Oracle PL/Sql, Linux and Java. You can contact Ajmal Abbasi for Consultancy, Technical Assistance and Technical Discussions.

More Posts - Website - Facebook - LinkedIn

15 thoughts on “TIBCO SOAP JMS Tutorial: How to Develop JMS Based Web Service in TIBCO BW

  1. Sundar

    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.

    Reply
  2. Pingback: SOAP Event Source Tutorial: How to Expose a Process as Web Service in TIBCO | TutorialsPedia

  3. Pingback: TIBCO Web Services: Top Interview Questions and Answers | TutorialsPedia

  4. chintan doshi

    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,

    Reply
  5. Srini

    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

    Reply
    1. Ajmal Abbasi Post author

      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

      Reply
  6. shreya

    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

    Reply
    1. Ajmal Abbasi Post author

      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

      Reply
  7. Muthu

    i’m not getting data for port and operation im SOAPRequestReply under configuration tab… plz advise

    Reply
  8. Thannawat

    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.

    Reply
  9. Sudheer

    can u please explain me the whole process how the Services are Called with SOAP reference..

    Reply
    1. Ajmal Abbasi Post author

      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

      Reply
  10. Murali

    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.

    Reply
    1. Amar

      HI Murali,

      In tester please start the service also along with the client request reply process.

      Reply
  11. amar

    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.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *