Simple HTTP Request Reply Project

Working with samples is always fun, so lets start with a Simple HTTP Request Reply Project. First of all let me explain the project step by step so that if one wants they can design one alongside on BW.

1. Open Designer, and create a “New Empty Project”. Drag and drop a Process Definition in the Project or one may also Right Click and select Add Resource -> Process -> Process Definition

2. Rename the Process Definition as “ClientProcess“, Repeat Step 1 and rename the process as “ServerProcess“. Right Click and insert “HTTP Connection” in the project and provide port as “8190” (you may use any port you want – 8190 is taken for sample only).  You may keep Server Type as “Tomcat” or “HttpComponent” – this sample works with both server types.

3. Double-click “ClientProcess“, one should see a Start and End Activities already in process. Right Click and insert “Send HTTP Request” Activity in the process, Enter hostname as ‘localhost’ and port as “8190” (Make sure this is same as what you have provided in HTTP Connection). Click Input Tab, Expand “RequestActivityInput” and enter “Some text as you wish” in “PostData” field. Link the Start, Send HTTP Request and End Activity using “Create transition”. ClientProcess may look like below:

4. Double-click “ServerProcess“, Right click and insert “HTTP Receiver” – One may notice here that since HTTP Receiver is a process starter, Start Activity is removed from process. Right Click and insert “Send HTTP Response”. Link HTTP Receiver, Send HTTP Response and End using create transition. ServerProcess may look like below:

5. Click HTTP Receiver, Click Browse button on HTTP Connection field available on Configuration Tab, and select HTTP Connection in popup.

6. Select Send HTTP Response, on Configuration tab, select “HTTP Receiver” in “Reply For” dropdown. Go to Input tab and expand ResponseActivityInput. Add some text for asciiContent. Save the project.

7. Click Tester on BusinessWorks, Start Testing, on popup window, Click “Select All” and then Click “Load Selected”. On Right panel, right click “ClientProcess” and click “Create a job”.

8. Once the process has executed successfully, one may be interested in seeing details of HTTP Request and Response. Click HTTP Receiver -> Output tab shows incoming HTTP Request and Send HTTP Response -> Output tab shows HTTP Response received.