HTTP based connectivity between different applications and between different processes inside a TIBCO BW project is a common thing that TIBCO developers come across. When it comes to transfer of data through HTTP, you have two options available:
- Send data through GET method in which parameters sent in HTTP request get concatenated to the Request URL.
- Send data through POST method in which data is posted as part of HTTP request body.
In this TIBCO HTTP Tutorial, I will explain step by step, how you can send HTTP Post data and then receive and parse the same data using HTTP Receiver activity.
Step 1: Create HTTP Connection
In order to develop any HTTP Based solution in TIBCO, the first task that comes in my mind is creation of a HTTP connection. Add a new HTTP Connection from the HTTP Palette and configure HTTP connection as shown below:
The configuration shows that this connection will be used to enable HTTP communication on localhost at port number 8899.
Step 2: Create XML File and Associated XSD Schema
In our tutorial, we will send an XML file through HTTP Post. So let’s first create XML file. I am going to use a simple XML File with an employee basic information as shown below:
<Employee>
<EmployeeName>Ajmal</EmployeeName>
<EmployeeAge>26</EmployeeAge>
</Employee>
Whenever you play with XML files in your TIBCO BW projects, you have to go for XML schemas. So let’s create XML Schema (XSD File) for this XML.
Our XML Schema created for this type of XML files is as shown below:
Step 3: Create TIBCO Process to Send HTTP Post Data
We will create a TIBCO BW Process SendHTTPPostData that will read XML data stored in a local file and then it will use Send HTTP Request activity to send the data towards a process where HTTP Receiver will be listening on given IP/Port to receive the data.
To read XML File, Read File activity is used. As shown in below screenshot, I have given path of XML file which will be read by this activity:
Below is configuration of Send HTTP Request activity. As you can see, same Host and Port are specified here which were used while creating HTTP Connection in Step 1. As we will be sending data through POST method (and not GET method), so I haven’t added any parameters here:
In the Input tab of Send HTTP Request activity, I have specified “POST” as method and in the PostData, XML file content read through Read File activity have been specified:
That’s it for our sending side. Now we need to move towards development of other process which will receive POST data and do any processing logic required.
Step 4: Create TIBCO BW Process to receive HTTP Post data
HTTP Receiver activity is used as process starter in our receiver process ParseHTTPPostData. As you can see in below screenshot, HTTP connection created in step 1 is specified in configuration of our HTTP receiver activity which means it will be listening on the IP and Port given in our HTTP Connection. In Output Style we have chosen String as we will be sending text based data.
Complete configuration of HTTP Receiver activity will look like below:
In our process, after receiving HTTP Post data in the form of an XML string, we will use Parse XML activity. In Parse XML input tab, HTTP Receiver’s PostData is mapped to XMLString as shown in below screenshot:
In the Output Editor tab of Parse XML activity, choose Employee XSD that we created in step 2 as shown below:
Now output tab of Parse XML activity will look like below based on the Schema that we selected above in Output Editor tab:
After parsing XML data received through HTTP Receiver by POST method, now we won’t be doing any other activities in the data in this tutorial. We just need to send HTTP Response to the sender to tell that everything has gone fine at receiving side.
For this purpose we will use Send HTTP Response activity. In the configuration tab of Send HTTP Response activity, choose HTTP Receiver in Reply For drop down. Configuration of Send HTTP Response will look like below:
In the Input tab of our Send HTTP Response activity, we are going to send a simple String in response with the text “Request Received Successfully.” as shown below:
That concludes development of our both processes and now we are good to go for testing our HTTP Post based solution.
Step 5: Test TIBCO HTTP Post Data
Validate the project to make sure everything has been developed and configured properly. After successful validation, load both processes (SendHTTPPostData process and ParseHTTPPostData process) in designer tester.
Create a new Job for SendHTTPPostData process and you will see that both processes have run successfully.
To verify that everything has worked fine, go to the process SendHTTPPostData in tester mode and look into the Input Data tab for Send HTTP Request activity. As you can see in below screenshot, correct PostData has been sent by our Send HTTP Request activity (XML file contents read by Read File activity):
Now if you see Output tab of Parse Data activity in process ParseHTTPPostData in tester mode, you will see that It has rightly parsed Post Data that was received by HTTP Receiver as shown below:
If you go to Input Data tab of Send HTTP Response activity, you can see that It has successfully sent the response to the sending activity:
Now you can go to output tab of Send HTTP Request activity and verify that final response has been received:
Pingback: TIBCO HTTP GET Tutorial: How to Receive Data in TIBCO Using HTTP GET | Tibco Guide
How will I send http request to outside world? e.g.
https://www.google.co.uk/#q=java
and get the results.
Hi Ajmal
How do you create the New JOb you referred in the Step 5 “Create a new Job for SendHTTPPostData process and you will see that both processes have run successfully”
On my installation it lets me start either of the processes HTTPPostData or ParseHTTPPostData, but not both.
How can i run both of them.
thanks in advance for your help
thanks
Avinash
Hi – We’re using TIBCO BW V5.7.2HF11. Messages coming in are accepted in via a HTTP receiver and posted out on EMS queues to the relevant third party systems. When the downstream systems response times increase we’ve notice that threads get hung/stuck within our Web service BW engine – we can see this via Administrator. In order to get it working back to normal we have to restart the engine. Our BW engines with JMS receiver process starters to not seem to experience this same problem. Any ideas as to why this would happen to Web specific services/engines and why the threads/job would not automatically flush out? Any ideas on how to resolve this problem?
Hi Saravana,
We are facing exactly the same problem. Have you got any resolution for this issue? If so can you share us the details please?
Regards,
Siva
hi Ajmal ,
Thanks for Sharing this.However , when i run this process , i m getting “The Http Server replied with a 5XX status code” error in send HTTP Request” .
Could you please help me with this.
Thanks , Priya
Dear Priya,
Please use some different port which is available. 5xx error means connection not getting established with given IP and PORT.
Thanks Ajmal ,
I have tried using the avalible ports to my IP addres through netstat -a Command.
However , getting the same Error of 5XX…..Also i have tried all the common ports which we use in tibco ,. but in all the cases it is returning this error.
Please help.
Just change the port it will work. 5XX code will come when the port is duplicated you need to kill it from back end or easy way is change the port and test it.
Hi . I am new to tibco bw. I want to maintain a website using bw. suppose I have a userregistration.html page. I want to store the user registration details into database. After successful registration it will go to login. I create a http connection localhost with port 8080 but how can i specify the URL. like localhost:8080/userregistration.html. Where can I specify this URL? and please tell me how to maintain a total wobsite using bw. How can I receive multiple requests using the same http receiver?.
How can I receive parameters or request from a particular html page. localhost:8080/userregistration.html. for http connection we specify localhost and port number. But how to specify userregistration.html in http connection resource or in http receiver.
hi,
I’m facing exactly the same problem. Have you got any resolution for this issue? If so can you share it the details please?
Sir, I am new to TIBCO and I am trying to do the following functionality:
I enter a search tag in a textbox on an html page, on submitting the text, I want the user to be redirected to google.
How can I implement this?
Hi SIr.
I need to connect a https url [without certificates/SSL disabled]. Is it possible via send HTTP Request pallete.
Hi Ajmal,
How to add basic authentication in the header of HTTP.
Could you help me in doing it.
Thanks,
Sruthi.
Hi,
I am sending request using Send HTTP Request with content encoding as gzip with payload as binary (Zipped content). It gives error, but if i send request with content encoding as gzip and payload as unzipped data it works.
Are there any settings at service or administrator level that is zipping my content ?
Hi There,
Hip Hip Hooray! I was always told that slightly slow in the head, a slow learner. Not anymore! It’s like you have my back. I can’t tell you how much I’ve learnt here and how easily! Thank you for blessing me with this effortlessly ingestible digestible content.
I need help with exporting data table.
I’m using CSV file as the data source.
In the table(visualization) I’m filtering the records using limit data expression.
I want in web player that user can export the original data table used.( all the data without filtration).
I’m using Spotfire 7.6
Appreciate your effort for making such useful blogs and helping the community.
Shukran,
Abhiram
I realize you have to add the namespace in the employees xml file for the processes to work, otherwise you will get an error “The Http Server replied with a 5XX status code” error in send HTTP Request, and both processes will fail .
Your xml file should look like this:
Ajmal
26
(Note that “SendReceiveHTTP” is the name of my project, so that will be different depending on your project name)
You can obtain the xmlns value by clicking on the EmployeeSchema in the project, then clicking the “source” tab in the top command bar.
BW-HTTP-100001 Job-3000 Error in [HttpGet/ClientPostFile.process/Send HTTP Request]
The Http Server replied with a 5XX status code
I followed the same steps as you did. I am not getting where I made the mistake.
Can you please help me out?
Hi,
I was strated doing this tutorial but in the step 5 i was getting this error anyone can please help me .
BW-HTTP-100300 Job-5000 Error in [Processes/Process Definition.process/Send HTTP Request]
An IOException was thrown while trying to execute the Http method
caused by: java.net.ConnectException: Connection refused: connect
Hi ,
Can someone help me with below query ?
HOW to set boundary parameter when content-type is “multipart/form-data” in post operation.