TIBCO HTTP GET Tutorial: How to Receive Data in TIBCO Using HTTP GET

In a previous tutorial, I taught you how to receive data in TIBCO BW process using HTTP POST method. In this tutorial, I will teach you how you can receive data in TIBCO with TIBCO HTTP GET Method.

So you are well aware of the difference between HTTP POST and HTTP GET in general? If yes then that’s great. If not, I am here to tell you!!

In case of HTTP POST, data sent from sender is received in the body of HTTP message which can be then accessed in TIBCO process from PostData variable of HTTP Receiver. This data doesn’t become part of HTTP URL while sending request towards HTTP Server.

On the other hand, in case of HTTP GET, data (parameters) sent from the client are sent as part of HTTP URL and these parameters are then accessed in TIBCO Processes from Parameters variable of HTTP Receiver.

Ok, now we move forward with step by step tutorial on working with HTTP GET data in TIBCO. We are going to develop a HTTP based process which will take a file name as input through GET method and then it will return contents of that file as HTTP Response. In case it fails to find the file, it will return a custom HTTP Response message.

Step 1: Create HTTP Connection

Anytime you go for HTTP based messaging in TIBCO, first step is to create HTTP Connection. From the HTTP Palette choose HTTP Connection activity and drag it in your project design window.

Now configure your HTTP Connection by specifying IP, Port etc. as shown below:

tibco http get create connection

 

Step 2: Create TIBCO Process to receive HTTP GET data

In order to receive HTTP GET data in TIBCO, we create a new process and use HTTP Receiver activity as process starter for it.

In the configuration tab of HTTP Receiver, choose HTTP Connection (that was created in step 1). In the parameters option, click on (+) sign to add a new parameter. This parameter will be used to receive HTTP GET data.

Complete configuration of HTTP Receiver activity will look like below:

tibco http receiver parameter configuration

As you can see in below screenshot, newly created parameter is now available under parameters in the Output tab of HTTP Receiver:

tibco http receiver output parameters for get

 

In order to read file contents, we use Read File activity in our process. In the Input of Read File activity, we have used the file name that we received as HTTP GET parameter. We have concatenated this file name with our path to give absolute file path as shown in below screenshot:

tibco http get read file input mapping

We will have two transitions from our Read File activity to the next activities. In case of Success of Read File activity, we will have a transition to Send HTTP Response activity to send file contents.
In the configuration tab of Send HTTP Response activity, we choose HTTP Receiver for which we are sending back this response as shown below:

tibco http get send response configuration

In the Input tab of Send HTTP Response activity for success cases, File Contents read through Read File activity are mapped which will be sent as response data.

Input tab mapping of Send HTTP Success Response is shown in below screenshot:

tibco http get send response input for success scenario

In case of any error in Read File activity, error transition will be followed and Send Failure Response will be used to send response back to the client.

In the Input tab of this failure HTTP Response activity, we are sending a custom message as shown below:

tibco http get response input mapping for error

Now we are done with our process development. Validate the project and after successful validation, move to the testing step.

Step 3: Test TIBCO HTTP Get Method

Before testing the process, create some files at the path which was specified in Read File activity. In my case, I have created two files (student.txt and teacher.txt) at the given path as you can see below:

tibco http get tutorial files

 

Load the process in TIBCO Designer tester. After loading the process in tester, go to your browser and type following in the URL field:

http://localhost:8899/?filename=teacher

As a file with the name teacher.txt was present at the given path, so I got following response back on my browser window:

tester tibco http response for get method

You can also observe from above screenshot that success transition path has been followed in our process as file was successfully read by the process.

Now in order to test failure scenario, we will give a filename in the URL for which file doesn’t exist. For this, I typed following URL in my browser:

http://localhost:8899/?filename=doctor

Now, we got error message in response and we can also see from the below screenshot that now, error transition has been followed (as file read activity failed):

tester tibco http response for error scenario GET method

 

Ajmal Abbasi

Ajmal Hussain Abbasi is Integration Consultant By Profession with 13+ years experience in Integration domain mainly with TIBCO products. He has extensive practical knowledge of TIBCO Business Works, TIBCO Cloud, TIBCO Flogo, TIBCO Mashery, TIBCO Spotfire, EMS and TIBCO ActiveSpaces. He has worked on a number of highly critical integration projects in various sectors by using his skills in TIBCO Flogo, TIBCO API Management (Mashery), TCI, Tibco Designer, TIBCO Business Studio, Adapters, TIBCO EMS, RV, Administrator, TIBCO BE, TIBCO ActiveSpaces etc. Ajmal Abbasi has experience with MuleSoft ESB as well. Ajmal Abbasi is also experienced in the area of API Management particularly with WSO2 API management platforms. Ajmal Abbasi is also experienced in developing solutions using Core Java and J2EE Technologies. You can contact Ajmal Abbasi for Consultancy, Technical Assistance and Technical Discussions.

More Posts - Website - Facebook - LinkedIn - YouTube

11 thoughts on “TIBCO HTTP GET Tutorial: How to Receive Data in TIBCO Using HTTP GET

  1. KD Mishra

    Hi Ajmal,

    Thanks for such interesting and very useful posts of TIBCO World. I am also a TIBCO BW developer with overall 3.2 Years of Experiance.
    I found your blog very helpful, specially for the POCs related to these posts. So thanks once again. However in this particular post “TIBCO HTTP GET Tutorial” I got to no one minor typing mistake which is present in para starting with
    “Ok, now we move forward with step by step tutorial on working with HTTP Post data in TIBCO. We are going to…”
    Here you have written “HTTP Post data”, whereas as per my understanding you were about the write “HTTP Get data”. As in this particular tutorial ou have explained the steps for HTTP Get Method in TIBCO BW.

    Thanks,
    K.D.Mishra

    Reply
    1. Ajmal Abbasi Post author

      Dear Mishra,

      Many thanks for appreciation and for the correction. I have updated the post with the typing mistake removed. Your support is much appreciated.

      Reply
  2. Rakesh

    Hi Ajmal,

    I have a requirement to automate a manual process of downloading a file from HTTPS website with some user credentials with TIBCO HTTPS activity.
    I couldn’t download file, but I could get text content of the file and write it to some file in local drive.
    But if possible can you help me in achieving this through HTTPS i.e.. authenticated site by usine some username and pwd dtls.

    Reply
  3. nikhil dash

    Hi Ajmal,

    I have tried above tutorial . Everything is coming . But when I am giving request from web browser 2 job creating in tester . One is getting completed with success message . One is getting failed .

    Reply
    1. Vinay

      First of all Thanks Ajmal for this tutorial . Very helpful and simple 🙂

      @Nikhil,
      Try using the send/go arrow key . Sometimes enter gets pressed multiple times and hence the outcome , where 1 succeeds and the rest fail.

      Warm Regards,
      Vinay

      Reply
  4. Pingback: 15 Most Popular TIBCO Tutorials on TutorialsPedia | TutorialsPedia

  5. miga

    Thanks for your website ! it is almways helpful !

    I am looking how to download pdf file from one URL, can I use HTTP connection ? thanks

    Reply
  6. dhruv

    i have an doubt reagarding how to configure SFTP protocol when we want send a mail.

    Reply
    1. suresh

      Hai Ajmal,
      I have one doubt that is I try to perform post operation On HTTP receiver from postman.But it was not get the data. How to send data (HTTP – Body) from postman into http receiver.

      Reply

Leave a Reply

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